| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | ZipShort(byte[]
the bytes to store as a ZipShort bytes, int the offset to start offset)Create instance from the two bytes starting at offset. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public boolean | Returns: true if the objects are equalan object to compare o)Overrides java. |
| public byte[] | Returns: the value as a a two byte array in big endian byte orderGet value as two bytes in big endian byte order. |
| public static byte[] | Returns: the converted int as a byte array in big endian byte orderthe Java int to convert to bytes value)Get value as two bytes in big endian byte order. |
| public int | |
| public static int | Returns: the corresponding java int valuethe array of bytes bytes, int the offset to start offset)Helper method to get the value as a java int from two bytes starting at given array offset |
| public static int | Returns: the corresponding java int valuethe array of bytes bytes)Helper method to get the value as a java int from a two-byte array |
| public int | Returns: the value stored in the ZipShortOverrides java. |
| public static void | putShort(int
the Java int to convert to bytes value, byte[] the output buffer buf, int The offset within the output buffer of the first byte to be written.
must be non-negative and no larger than offset)buf.length-2put the value as two bytes in big endian byte order. |
| public String |
| BYTE_1_MASK | back to summary |
|---|---|
| private static final int BYTE_1_MASK | |
| BYTE_1_SHIFT | back to summary |
|---|---|
| private static final int BYTE_1_SHIFT | |
| value | back to summary |
|---|---|
| private final int value | |
| ZipShort | back to summary |
|---|---|
| public ZipShort(int value) Create instance from a number.
| |
| ZipShort | back to summary |
|---|---|
| public ZipShort(byte[] bytes) Create instance from bytes.
| |
| ZipShort | back to summary |
|---|---|
| public ZipShort(byte[] bytes, int offset) Create instance from the two bytes starting at offset.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Override to make two instances with same value equal. | |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes() Get value as two bytes in big endian byte order.
| |
| getBytes | back to summary |
|---|---|
| public static byte[] getBytes(int value) Get value as two bytes in big endian byte order.
| |
| getValue | back to summary |
|---|---|
| public int getValue() Get value as Java int.
| |
| getValue | back to summary |
|---|---|
| public static int getValue(byte[] bytes, int offset) Helper method to get the value as a java int from two bytes starting at given array offset
| |
| getValue | back to summary |
|---|---|
| public static int getValue(byte[] bytes) Helper method to get the value as a java int from a two-byte array
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Override to make two instances with same value equal.
| |
| putShort | back to summary |
|---|---|
| public static void putShort(int value, byte[] buf, int offset) put the value as two bytes in big endian byte order.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |