| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| private final int | |
| public static final ZipShort | ZERO
ZipShort with a value of 0. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ZipShort(final byte[]
the bytes to store as a ZipShort bytes, final int the offset to start offset)Constructs a new instance from the two bytes starting at offset. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public boolean | Returns: true if the objects are equalan object to compare o)Overrides java. |
| public static byte[] | Returns: the converted int as a byte array in big-endian byte orderthe Java int to convert to bytes value)Gets value as two bytes in big-endian byte order. |
| public byte[] | Returns: the value as a two byte array in big-endian byte orderGets value as two bytes in big-endian byte order. |
| 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 static int | Returns: the corresponding Java int valuethe array of bytes bytes, final 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 int | |
| public int | Returns: the value stored in the ZipShortOverrides java. |
| public static void | putShort(final int
the Java int to convert to bytes value, final byte[] the output buffer buf, final 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 |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| value | back to summary |
|---|---|
| private final int value | |
| ZERO | back to summary |
|---|---|
| public static final ZipShort ZERO ZipShort with a value of 0.
| |
| ZipShort | back to summary |
|---|---|
| public ZipShort(final byte[] bytes) Constructs a new instance from bytes.
| |
| ZipShort | back to summary |
|---|---|
| public ZipShort(final byte[] bytes, final int offset) Constructs a new instance from the two bytes starting at offset.
| |
| ZipShort | back to summary |
|---|---|
| public ZipShort(final int value) Constructs a new instance from a number.
| |
| 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(final Object o) Overrides java. Override to make two instances with same value equal. | |
| getBytes | back to summary |
|---|---|
| public static byte[] getBytes(final int value) Gets value as two bytes in big-endian byte order.
| |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes() Gets value as two bytes in big-endian byte order.
| |
| getValue | back to summary |
|---|---|
| public static int getValue(final byte[] bytes) Helper method to get the value as a Java int from a two-byte array
| |
| getValue | back to summary |
|---|---|
| public static int getValue(final byte[] bytes, final 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 int getValue() Gets value as Java int.
| |
| 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(final int value, final byte[] buf, final 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. | |