|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jibx.runtime.impl.OutByteBuffer
public class OutByteBuffer
Byte buffer wrapping an output stream. Clients need to obey the interface access rules.
Field Summary | |
---|---|
static int |
DEFAULT_BUFFER_SIZE
Default output buffer size. |
Constructor Summary | |
---|---|
OutByteBuffer()
Constructor using default buffer size. |
|
OutByteBuffer(int size)
Constructor with size specified. |
Method Summary | |
---|---|
void |
finish()
Complete usage of the current stream. |
void |
flush()
Empty the buffer. |
void |
free(int reserve,
int size)
Free at least some number of bytes of space in the byte array. |
byte[] |
getBuffer()
Get the byte array buffer. |
int |
getOffset()
Get the index of the next byte to be read. |
void |
reset()
Reset to initial state for reuse. |
void |
setOffset(int offset)
Set the current offset. |
void |
setOutput(java.io.OutputStream os)
Set output stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_BUFFER_SIZE
Constructor Detail |
---|
public OutByteBuffer(int size)
size
- initial buffer size in bytespublic OutByteBuffer()
Method Detail |
---|
public void reset()
public void setOutput(java.io.OutputStream os)
os
- streampublic byte[] getBuffer()
getBuffer
in interface IByteBuffer
public int getOffset()
setOffset(int)
method must be used to update the current offset before
any other operations are performed on the buffer.
getOffset
in interface IByteBuffer
public void setOffset(int offset)
setOffset
in interface IByteBuffer
offset
- public void free(int reserve, int size) throws java.io.IOException
getBuffer()
and IByteBuffer.getOffset()
must always be called
again before any further use of the buffer.
free
in interface IOutByteBuffer
reserve
- offset of data to be preserved in buffer (nothing
preserved if greater than or equal to current offset)size
- desired number of bytes
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface IOutByteBuffer
java.io.IOException
public void finish() throws java.io.IOException
setOutput(OutputStream)
is
required before the buffer can again be used.
finish
in interface IByteBuffer
java.io.IOException
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |