|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
java.io.OutputStream
com.tangosol.io.MultiByteArrayOutputStream
public class MultiByteArrayOutputStream
An OutputStream that accumulates the written data to a series of byte arrays that do not exceed a specified size.
| Field Summary | |
|---|---|
protected byte[] |
m_abThe current block of output. |
protected int |
m_cbBlockThe max size of each block. |
protected int |
m_cBlocksThe number of flushed blocks. |
protected int |
m_cbPadBackThe number of additional bytes to allocate and leave free at the back (end) of each block |
protected int |
m_cbPadFrontThe number of additional bytes to allocate and leave free at the front (start) of each block |
protected boolean |
m_fClosedTrue after close is invoked. |
protected java.util.List |
m_listBlockThe list of blocks. |
protected int |
m_ofThe offset into the current block of output. |
| Constructor Summary | |
|---|---|
MultiByteArrayOutputStream(int cbBlock)Construct a MultiByteArrayOutputStream to write to byte arrays of the specified length. |
|
MultiByteArrayOutputStream(int cbBlock, int cbPadFront, int cbPadBack)Construct a MultiByteArrayOutputStream to write to byte arrays of the specified length, leaving the specified amount of padding at the front and back of each byte array. |
|
| Method Summary | |
|---|---|
protected void |
check()Verify that the stream is still open. |
void |
close()Close the stream, flushing any accumulated bytes. |
void |
flush()Flush any accumulated bytes. |
int |
getBackPaddingSize()Determine the number of extra bytes of padding that will be allocated and left blank at the end of each block after the data portion. |
byte[] |
getBlock(int i)Obtain the specified block of data. |
int |
getBlockCount()Determine the number of blocks that have been written thus far. |
int |
getBlockDataSize()Determine the maximum number of bytes of data that will be stored in each block. |
int |
getBlockDataSize(int i)Determine the specific number of bytes of data stored in the specified block. |
int |
getFrontPaddingSize()Determine the number of extra bytes of padding that will be allocated and left blank at the start of each block in front of the data portion. |
protected int |
requestCapacity(int cbMore)Ensure that the current block contains some available capacity, preferably enough to fulfill the specified capacity. |
java.lang.String |
toString()Create a human readable string representing the data written to the stream. |
void |
write(byte[] abSrc, int ofSrc, int cbSrc)Writes len bytes from the specified byte array starting at offset off to this output stream. |
void |
write(int b)Writes the specified byte to this output stream. |
| Methods inherited from class java.io.OutputStream |
|---|
write |
| Methods inherited from interface com.tangosol.io.OutputStreaming |
|---|
write |
| Field Detail |
|---|
protected byte[] m_ab
protected int m_of
protected int m_cbBlock
protected int m_cbPadFront
protected int m_cbPadBack
protected java.util.List m_listBlock
protected int m_cBlocks
protected boolean m_fClosed
| Constructor Detail |
|---|
public MultiByteArrayOutputStream(int cbBlock)
cbBlock - the number of bytes (maximum) per block
public MultiByteArrayOutputStream(int cbBlock,
int cbPadFront,
int cbPadBack)
cbBlock - the number of data bytes (maximum) per blockcbPadFront - the number of additional bytes to allocate and leave free at the front (start) of each blockcbPadBack - the number of additional bytes to allocate and leave free at the back (end) of each block| Method Detail |
|---|
public void write(int b)
throws java.io.IOException
write in interface OutputStreamingwrite in class java.io.OutputStreamb - the byte.java.io.IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
public void write(byte[] abSrc,
int ofSrc,
int cbSrc)
throws java.io.IOException
len bytes from the specified byte array starting at offset off to this output stream.
If b is null, a NullPointerException is thrown.
If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.
write in interface OutputStreamingwrite in class java.io.OutputStreamabSrc - the dataofSrc - the start offset in the datacbSrc - the number of bytes to writejava.io.IOException - if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
public void flush()
throws java.io.IOException
flush in interface OutputStreamingflush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException - if an I/O error occurs
public void close()
throws java.io.IOException
close in interface OutputStreamingclose in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOException - if an I/O error occurspublic java.lang.String toString()
public int getBlockCount()
public byte[] getBlock(int i)
i - block index in the range [0..getBlockCount()]; passing the getBlockCount() will return the active blockpublic int getBlockDataSize(int i)
i - block index in the range [0..getBlockCount()]; passing the getBlockCount() will return the size of the active blockpublic int getBlockDataSize()
public int getFrontPaddingSize()
public int getBackPaddingSize()
protected void check()
throws java.io.IOException
java.io.IOExceptionprotected int requestCapacity(int cbMore)
cbMore - the requested capacity
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||