|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.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 to| Method Detail |
|---|
public ByteBuffer getByteBuffer()
public void write(int b)
throws IOException
write in interface OutputStreamingwrite in class OutputStreamb - the byte
IOException - if an I/O error occurs
public 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 OutputStreamingwrite in class OutputStreamabSrc - the dataofSrc - the start offset in the datacbSrc - the number of bytes to write
IOException - if an I/O error occurs
public void flush()
throws IOException
flush in interface OutputStreamingflush in interface Flushableflush in class OutputStreamIOException - if an I/O error occurs
public void close()
throws IOException
close in interface OutputStreamingclose in interface Closeableclose in class OutputStreamIOException - 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 NPE
IOException - if the stream is closed
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||