class ByteBuffer
extends java.io.OutputStream
Modifier and Type | Field and Description |
---|---|
protected int |
capacityIncrement
The size of the increment.
|
(package private) byte[] |
data
The buffer where elements are stored.
|
(package private) int |
length
The number of elements in the buffer.
|
(package private) java.lang.String |
myname |
Constructor and Description |
---|
ByteBuffer()
Constructs an empty vector.
|
ByteBuffer(byte[] data)
Constructs a full vector.
|
ByteBuffer(byte[] data,
int capacityIncrement)
Constructs a full vector.
|
ByteBuffer(int initialCapacity)
Constructs an empty vector with the specified storage capacity.
|
ByteBuffer(int initialCapacity,
int capacityIncrement)
Constructs an empty vector with the specified storage capacity and the specified
capacityIncrement.
|
Modifier and Type | Method and Description |
---|---|
void |
append(long val,
int width) |
void |
ensureCapacity(int minCapacity)
Ensures that the vector has at least the specified capacity.
|
int |
size()
Returns the number of elements in the vector.
|
void |
write(int val) |
void |
writeAt(int index,
long val,
int width) |
java.lang.String myname
byte[] data
int length
protected int capacityIncrement
public ByteBuffer(int initialCapacity, int capacityIncrement)
initialCapacity
- the initial storage capacity of the vectorcapacityIncrement
- how much to increase the element's size by.public ByteBuffer(int initialCapacity)
initialCapacity
- the initial storage capacity of the vectorpublic ByteBuffer()
public ByteBuffer(byte[] data, int capacityIncrement)
public ByteBuffer(byte[] data)
public final int size()
public final void ensureCapacity(int minCapacity)
minCapacity
- the desired minimum capacitypublic void write(int val)
write
in class java.io.OutputStream
public void writeAt(int index, long val, int width)
public void append(long val, int width)