|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.org.ogsadai.common.SimpleBlockBuffer
A simple BlockBuffer for appending sequences of
java.lang.String, byte[] or
org.w3c.dom.Node objects.
The aggregated block returned by the toBlock method will
be either a String containing all the string and node
data, or a byte[] containing all the binary data.
| Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
|
private static DAILogger |
LOG
|
private java.io.ByteArrayOutputStream |
mBinaryData
|
private int |
mSize
|
private java.lang.StringBuffer |
mStringData
|
| Constructor Summary | |
SimpleBlockBuffer()
|
|
| Method Summary | |
void |
appendBlock(java.lang.Object block)
Appends the specified block to the buffer. |
private void |
appendByteArray(byte[] block)
Append a byte array to the buffer. |
private void |
appendNode(java.lang.Object block)
Append an org.w3c.dom.Node to the buffer. |
int |
size()
Returns a count of the number of blocks that have been appended to the buffer. |
java.lang.Object |
toBlock()
Returns a single block containing all the data appended to the buffer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static final DAILogger LOG
private final java.lang.StringBuffer mStringData
private final java.io.ByteArrayOutputStream mBinaryData
private int mSize
| Constructor Detail |
public SimpleBlockBuffer()
| Method Detail |
public void appendBlock(java.lang.Object block)
throws OutOfMemoryException
BlockBuffer
appendBlock in interface BlockBufferblock - The block to append.
OutOfMemoryException - if there is not enough memory
to retrieve the block.
public java.lang.Object toBlock()
throws OutOfMemoryException
BlockBuffernull is
returned.
toBlock in interface BlockBufferOutOfMemoryException - if there is not enough memory
to retrieve the block.
private void appendByteArray(byte[] block)
throws OutOfMemoryException
block - Byte array.
OutOfMemoryException - if there is no memory available
to append the block.
private void appendNode(java.lang.Object block)
throws OutOfMemoryException
org.w3c.dom.Node to the buffer.
block - Node object.
OutOfMemoryException - if there is no memory available
to append the block.public int size()
BlockBuffer
size in interface BlockBuffer
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||