|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.util.ByteArrayBuffer
public class ByteArrayBuffer
The ByteArrayBuffer
is a linear byte buffer designed for stream
implementations. Aside from its content, the essential properties of a buffer
are its position and limit.
A buffer's position is the index of the next byte to be read or written. A buffer's position is never negative and is never greater than its limit. A buffer's position changes as individual bytes are being read or written.A buffer's limit is the index of the first byte that should not be read or written. A buffer's limit is never negative and is never greater than its current capacity. A buffer's limit changes as required or as external bulk operations command.
Field Summary | |
---|---|
protected byte[] |
buffer
Deprecated. |
protected int |
limit
Deprecated. |
protected int |
position
Deprecated. |
Constructor Summary | |
---|---|
ByteArrayBuffer()
Deprecated. |
Method Summary | |
---|---|
void |
clear()
Deprecated. Clears this buffer. |
void |
copy(int source_position,
int dest_position,
int length)
Deprecated. Copies a region of bytes in the buffer. |
void |
ensureCapacity(int required_capacity)
Deprecated. Ensures that the byte array has at least the specified capacity. |
void |
expandLimit(int required_limit)
Deprecated. Expands byte array to the specified limit (or more). |
byte[] |
getBuffer()
Deprecated. Returns the byte array that backs this buffer. |
int |
getLimit()
Deprecated. Returns this buffer's limit. |
int |
getPosition()
Deprecated. Returns this buffer's position. |
void |
setBuffer(byte[] new_buffer)
Deprecated. Sets specified byte array to be used for buffering. |
void |
setLimit(int new_limit)
Deprecated. Sets this buffer's limit. |
void |
setPosition(int new_position)
Deprecated. Sets this buffer's position. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected byte[] buffer
protected int position
protected int limit
Constructor Detail |
---|
public ByteArrayBuffer()
Method Detail |
---|
public byte[] getBuffer()
public void setBuffer(byte[] new_buffer)
public int getPosition()
public void setPosition(int new_position)
java.lang.IllegalArgumentException
- if the new position is negative
or is larger than the current limit.public int getLimit()
public void setLimit(int new_limit)
java.lang.IllegalArgumentException
- if the new limit is negative
or is larger than the current capacity.public void ensureCapacity(int required_capacity)
public void clear()
public void copy(int source_position, int dest_position, int length)
java.lang.IndexOutOfBoundsException
- if copying would cause
access of data outside current buffer array bounds.public void expandLimit(int required_limit) throws java.io.IOException
This method shall be used internally when position reaches limit. This method may be overriden to change memory management behavior.
java.io.IOException
- if an I/O error occurs (expansion impossible).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |