src/java.base/share/classes/java/util/zip/ZipUtils.java

Print this page




 127      */
 128     public static final int get16(byte b[], int off) {
 129         return Byte.toUnsignedInt(b[off]) | (Byte.toUnsignedInt(b[off+1]) << 8);
 130     }
 131 
 132     /**
 133      * Fetches unsigned 32-bit value from byte array at specified offset.
 134      * The bytes are assumed to be in Intel (little-endian) byte order.
 135      */
 136     public static final long get32(byte b[], int off) {
 137         return (get16(b, off) | ((long)get16(b, off+2) << 16)) & 0xffffffffL;
 138     }
 139 
 140     /**
 141      * Fetches signed 64-bit value from byte array at specified offset.
 142      * The bytes are assumed to be in Intel (little-endian) byte order.
 143      */
 144     public static final long get64(byte b[], int off) {
 145         return get32(b, off) | (get32(b, off+4) << 32);
 146     }









 147 }


 127      */
 128     public static final int get16(byte b[], int off) {
 129         return Byte.toUnsignedInt(b[off]) | (Byte.toUnsignedInt(b[off+1]) << 8);
 130     }
 131 
 132     /**
 133      * Fetches unsigned 32-bit value from byte array at specified offset.
 134      * The bytes are assumed to be in Intel (little-endian) byte order.
 135      */
 136     public static final long get32(byte b[], int off) {
 137         return (get16(b, off) | ((long)get16(b, off+2) << 16)) & 0xffffffffL;
 138     }
 139 
 140     /**
 141      * Fetches signed 64-bit value from byte array at specified offset.
 142      * The bytes are assumed to be in Intel (little-endian) byte order.
 143      */
 144     public static final long get64(byte b[], int off) {
 145         return get32(b, off) | (get32(b, off+4) << 32);
 146     }
 147 
 148     /**
 149      * Fetches signed 32-bit value from byte array at specified offset.
 150      * The bytes are assumed to be in Intel (little-endian) byte order.
 151      *
 152      */
 153     public static final int get32S(byte b[], int off) {
 154         return (get16(b, off) | (get16(b, off+2) << 16));
 155     }
 156 }