public final class ByteArrayBuffer extends java.lang.Object implements ByteSequence
EMPTY
Constructor and Description |
---|
ByteArrayBuffer(byte[] bytes,
boolean dontCopy) |
ByteArrayBuffer(byte[] bytes,
int len,
boolean dontCopy) |
ByteArrayBuffer(int capacity) |
Modifier and Type | Method and Description |
---|---|
void |
append(byte[] b,
int off,
int len) |
void |
append(int b) |
byte[] |
buffer() |
byte |
byteAt(int i)
Returns the
byte value at the specified index. |
int |
capacity() |
void |
clear() |
int |
indexOf(byte b) |
int |
indexOf(byte b,
int beginIndex,
int endIndex) |
boolean |
isEmpty() |
boolean |
isFull() |
int |
length()
Returns the length of this byte sequence.
|
void |
remove(int off,
int len) |
void |
setLength(int len) |
byte[] |
toByteArray()
Copies the contents of this byte sequence into a newly allocated byte
array and returns that array.
|
java.lang.String |
toString() |
public ByteArrayBuffer(int capacity)
public ByteArrayBuffer(byte[] bytes, boolean dontCopy)
public ByteArrayBuffer(byte[] bytes, int len, boolean dontCopy)
public void append(byte[] b, int off, int len)
public void append(int b)
public void clear()
public byte[] toByteArray()
ByteSequence
toByteArray
in interface ByteSequence
public byte byteAt(int i)
ByteSequence
byte
value at the specified index.byteAt
in interface ByteSequence
i
- the index of the byte
value to be returned.byte
valuepublic int capacity()
public int length()
ByteSequence
length
in interface ByteSequence
byte
s in this sequence.public byte[] buffer()
public int indexOf(byte b)
public int indexOf(byte b, int beginIndex, int endIndex)
public void setLength(int len)
public void remove(int off, int len)
public boolean isEmpty()
public boolean isFull()
public java.lang.String toString()
toString
in class java.lang.Object