| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | ByteArrayBuffer(final int
the capacity capacity)Creates an instance of |
| Modifier and Type | Method and Description |
|---|---|
| public void | append(final byte[]
the bytes to be appended. b, final int the index of the first byte to append. off, final int the number of bytes to append. len)Appends |
| public void | |
| public void | append(final char[]
the chars to be appended. b, final int the index of the first char to append. off, final int the number of bytes to append. len)Appends |
| public void | append(final CharArrayBuffer
the chars to be appended. b, final int the index of the first char to append. off, final int the number of bytes to append. len)Appends |
| public byte[] | |
| public int | Returns: the byte value at the specified index.the index of the desired byte value. i)Returns the |
| public int | |
| public void | |
| public void | ensureCapacity(final int
the minimum required capacity. required)Ensures that the capacity is at least equal to the specified minimum. |
| private void | |
| public int | Returns: the index of the first occurrence of the byte in the buffer within the given bounds, or-1 if the byte does
not occur.the byte to search for. b, final int the index to start the search from. from, final int the index to finish the search at. to)Returns the index within this buffer of the first occurrence of the
specified byte, starting the search at the specified
|
| public int | |
| public boolean | |
| public boolean | Returns: true if this buffer is full, false
otherwise.Returns |
| public int | |
| public void | |
| public byte[] |
| buffer | back to summary |
|---|---|
| private byte[] buffer | |
| len | back to summary |
|---|---|
| private int len | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ByteArrayBuffer | back to summary |
|---|---|
| public ByteArrayBuffer(final int capacity) Creates an instance of
| |
| append | back to summary |
|---|---|
| public void append(final byte[] b, final int off, final int len) Appends
| |
| append | back to summary |
|---|---|
| public void append(final int b) Appends
| |
| append | back to summary |
|---|---|
| public void append(final char[] b, final int off, final int len) Appends The chars are converted to bytes using simple cast.
| |
| append | back to summary |
|---|---|
| public void append(final CharArrayBuffer b, final int off, final int len) Appends The chars are converted to bytes using simple cast.
| |
| buffer | back to summary |
|---|---|
| public byte[] buffer() Returns reference to the underlying byte array.
| |
| byteAt | back to summary |
|---|---|
| public int byteAt(final int i) Returns the
| |
| capacity | back to summary |
|---|---|
| public int capacity() Returns the current capacity. The capacity is the amount of storage available for newly appended bytes, beyond which an allocation will occur.
| |
| clear | back to summary |
|---|---|
| public void clear() Clears content of the buffer. The underlying byte array is not resized. | |
| ensureCapacity | back to summary |
|---|---|
| public void ensureCapacity(final int required) Ensures that the capacity is at least equal to the specified minimum.
If the current capacity is less than the argument, then a new internal
array is allocated with greater capacity. If the
| |
| expand | back to summary |
|---|---|
| private void expand(final int newlen) | |
| indexOf | back to summary |
|---|---|
| public int indexOf(final byte b, final int from, final int to) Returns the index within this buffer of the first occurrence of the
specified byte, starting the search at the specified
There is no restriction on the value of
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(final byte b) Returns the index within this buffer of the first occurrence of the
specified byte, starting the search at
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns
| |
| isFull | back to summary |
|---|---|
| public boolean isFull() Returns
| |
| length | back to summary |
|---|---|
| public int length() Returns the length of the buffer (byte count).
| |
| setLength | back to summary |
|---|---|
| public void setLength(final int len) Sets the length of the buffer. The new length value is expected to be
less than the current capacity and greater than or equal to
| |
| toByteArray | back to summary |
|---|---|
| public byte[] toByteArray() Converts the content of this buffer to an array of bytes.
| |