This class also allows the trio of array, offset and length to be carried around as a single object.
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | ByteArray(byte[] array, int offset, int length)
Create an instance of this class that wraps ths given array. |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Value equality for byte arrays. |
| private static boolean | equals(byte[] a, int aOffset, int aLength, byte[] b, int bOffset, int bLength)
Compare two byte arrays using value equality. |
| public final byte[] | |
| public final int | |
| public final int | |
| public int | |
| public void | |
| public void | |
| public void | |
| public void | |
| public final void | |
| public void |
| array | back to summary |
|---|---|
| private byte[] array | |
| length | back to summary |
|---|---|
| private int length | |
| offset | back to summary |
|---|---|
| private int offset | |
| ByteArray | back to summary |
|---|---|
| public ByteArray(byte[] array, int offset, int length) Create an instance of this class that wraps ths given array. This class does not make a copy of the array, it just saves the reference. | |
| ByteArray | back to summary |
|---|---|
| public ByteArray(byte[] array) | |
| ByteArray | back to summary |
|---|---|
| public ByteArray() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Value equality for byte arrays.
| |
| equals | back to summary |
|---|---|
| private static boolean equals(byte[] a, int aOffset, int aLength, byte[] b, int bOffset, int bLength) Compare two byte arrays using value equality. Two byte arrays are equal if their length is identical and their contents are identical. | |
| getArray | back to summary |
|---|---|
| public final byte[] getArray() | |
| getLength | back to summary |
|---|---|
| public final int getLength() | |
| getOffset | back to summary |
|---|---|
| public final int getOffset() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| readExternal | back to summary |
|---|---|
| public void readExternal(ObjectInput in) throws IOException Read this object from a stream of stored objects.
| |
| setBytes | back to summary |
|---|---|
| public void setBytes(byte[] array) | |
| setBytes | back to summary |
|---|---|
| public void setBytes(byte[] array, int length) | |
| setBytes | back to summary |
|---|---|
| public void setBytes(byte[] array, int offset, int length) | |
| setLength | back to summary |
|---|---|
| public final void setLength(int newLength) | |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(ObjectOutput out) throws IOException Write the byte array out w/o compression
| |