|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-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.nio.ByteBufferOutputStream
public class ByteBufferOutputStream
An OutputStream implementation on top of a Java NIO ByteBuffer.
Constructor Summary | |
---|---|
ByteBufferOutputStream(ByteBuffer buffer) Construct a ByteBufferOutputStream on a ByteBuffer object. |
Method Summary | |
---|---|
void |
close() Close the stream, flushing any accumulated bytes. |
void |
flush() Flush any accumulated bytes. |
ByteBuffer |
getByteBuffer() Obtain the ByteBuffer that this OutputStream is based on. |
protected static String |
includeMessage(Throwable e) Provide a "suffix" containing the exception message (if any). |
protected NullPointerException |
potentialStreamClosedException(NullPointerException e) Check if an NPE is caused by the stream being closed. |
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 |
Constructor Detail |
---|
public ByteBufferOutputStream(ByteBuffer buffer)
buffer
- the ByteBuffer to write the data toMethod Detail |
---|
public ByteBuffer getByteBuffer()
public void write(int b) throws IOException
write
in interface OutputStreaming
write
in class OutputStream
b
- the byte
IOException
- if an I/O error occurspublic void write(byte[] abSrc, int ofSrc, int cbSrc) throws 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 OutputStreaming
write
in class OutputStream
abSrc
- the dataofSrc
- the start offset in the datacbSrc
- the number of bytes to writeIOException
- if an I/O error occurspublic void flush() throws IOException
flush
in interface OutputStreaming
flush
in interface Flushable
flush
in class OutputStream
IOException
- if an I/O error occurspublic void close() throws IOException
close
in interface OutputStreaming
close
in interface Closeable
close
in class OutputStream
IOException
- if an I/O error occursprotected static String includeMessage(Throwable e)
e
- an exception (any Throwable object)protected NullPointerException potentialStreamClosedException(NullPointerException e) throws IOException
e
- an NPEIOException
- if the stream is closed
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |