| Modifier and Type | Field and Description |
|---|---|
| pack-priv byte[] | data
The content of this vector. |
| pack-priv int | length
The actual number of bytes in this vector. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ByteVector(final int
the initial capacity of the byte vector to be constructed. initialCapacity)Constructs a new |
| pack-priv | ByteVector(final byte[]
the initial data of the new byte vector. data)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final ByteVector | Returns: this byte vector.the String to encode. stringValue, final int the index of the first character to encode. The previous characters are supposed
to have already been encoded, using only one byte per character. offset, final int the maximum byte length of the encoded string, including the already
encoded characters. maxByteLength)Puts an UTF8 string into this byte vector. |
| private void | enlarge(final int
number of additional bytes that this byte vector should be able to receive. size)Enlarges this byte vector so that it can receive 'size' more bytes. |
| pack-priv final ByteVector | Returns: this byte vector.a byte. byteValue1, final int another byte. byteValue2)Puts two bytes into this byte vector. |
| pack-priv final ByteVector | Returns: this byte vector.a byte. byteValue1, final int another byte. byteValue2, final int a short. shortValue)Puts two bytes and a short into this byte vector. |
| pack-priv final ByteVector | Returns: this byte vector.a byte. byteValue, final int a short. shortValue)Puts a byte and a short into this byte vector. |
| pack-priv final ByteVector | Returns: this byte vector.a byte. byteValue, final int a short. shortValue1, final int another short. shortValue2)Puts one byte and two shorts into this byte vector. |
| public ByteVector | |
| public ByteVector | Returns: this byte vector.an array of bytes. May be null to put byteArrayValue, final int byteLength null
bytes into this byte vector.index of the first byte of byteArrayValue that must be copied. byteOffset, final int number of bytes of byteArrayValue that must be copied. byteLength)Puts an array of bytes into this byte vector. |
| public ByteVector | |
| public ByteVector | |
| public ByteVector | |
| public ByteVector | |
| public int | Returns: the actual number of bytes in this vector.Returns the actual number of bytes in this vector. |
| data | back to summary |
|---|---|
| pack-priv byte[] data The content of this vector. Only the first | |
| length | back to summary |
|---|---|
| pack-priv int length The actual number of bytes in this vector. | |
| ByteVector | back to summary |
|---|---|
| public ByteVector() Constructs a new | |
| ByteVector | back to summary |
|---|---|
| public ByteVector(final int initialCapacity) Constructs a new
| |
| ByteVector | back to summary |
|---|---|
| pack-priv ByteVector(final byte[] data) Constructs a new
| |
| encodeUtf8 | back to summary |
|---|---|
| pack-priv final ByteVector encodeUtf8(final String stringValue, final int offset, final int maxByteLength) Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if necessary. The string length is encoded in two bytes before the encoded characters, if there is space for that (i.e. if this.length - offset - 2 >= 0).
| |
| enlarge | back to summary |
|---|---|
| private void enlarge(final int size) Enlarges this byte vector so that it can receive 'size' more bytes.
| |
| put11 | back to summary |
|---|---|
| pack-priv final ByteVector put11(final int byteValue1, final int byteValue2) Puts two bytes into this byte vector. The byte vector is automatically enlarged if necessary.
| |
| put112 | back to summary |
|---|---|
| pack-priv final ByteVector put112(final int byteValue1, final int byteValue2, final int shortValue) Puts two bytes and a short into this byte vector. The byte vector is automatically enlarged if necessary.
| |
| put12 | back to summary |
|---|---|
| pack-priv final ByteVector put12(final int byteValue, final int shortValue) Puts a byte and a short into this byte vector. The byte vector is automatically enlarged if necessary.
| |
| put122 | back to summary |
|---|---|
| pack-priv final ByteVector put122(final int byteValue, final int shortValue1, final int shortValue2) Puts one byte and two shorts into this byte vector. The byte vector is automatically enlarged if necessary.
| |
| putByte | back to summary |
|---|---|
| public ByteVector putByte(final int byteValue) Puts a byte into this byte vector. The byte vector is automatically enlarged if necessary.
| |
| putByteArray | back to summary |
|---|---|
| public ByteVector putByteArray(final byte[] byteArrayValue, final int byteOffset, final int byteLength) Puts an array of bytes into this byte vector. The byte vector is automatically enlarged if necessary.
| |
| putInt | back to summary |
|---|---|
| public ByteVector putInt(final int intValue) Puts an int into this byte vector. The byte vector is automatically enlarged if necessary.
| |
| putLong | back to summary |
|---|---|
| public ByteVector putLong(final long longValue) Puts a long into this byte vector. The byte vector is automatically enlarged if necessary.
| |
| putShort | back to summary |
|---|---|
| public ByteVector putShort(final int shortValue) Puts a short into this byte vector. The byte vector is automatically enlarged if necessary.
| |
| putUTF8 | back to summary |
|---|---|
| public ByteVector putUTF8(final String stringValue) Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if necessary.
| |
| size | back to summary |
|---|---|
| public int size() Returns the actual number of bytes in this vector.
| |