|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.io.OutputStream
org.jppf.io.ByteBufferOutputStream
public class ByteBufferOutputStream
Implementation of an OutputStream backed by a ByteBuffer.
| Constructor Summary | |
|---|---|
ByteBufferOutputStream(ByteBuffer buffer)
Initialize this output stream with the specified backing ByteBuffer. |
|
ByteBufferOutputStream(int capacity)
Initialize this output stream with the specified capacity for the backing ByteBuffer. |
|
| Method Summary | |
|---|---|
void |
close()
Close this output stream and releases any system resources associated with it. |
void |
flush()
Flushes this output stream and force any buffered output bytes to be written out. |
ByteBuffer |
toByteBuffer()
Get the content of this output stream as a ByteBuffer. |
void |
write(byte[] b)
Writes b.length bytes from the specified byte array to this output stream. |
void |
write(byte[] b,
int off,
int len)
Write 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.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteBufferOutputStream(int capacity)
capacity - the capacity of the backing byte buffer.public ByteBufferOutputStream(ByteBuffer buffer)
buffer - the backing byte buffer.| Method Detail |
|---|
public void close()
throws IOException
close in interface Closeableclose in class OutputStreamIOException - if an I/O error occurs.OutputStream.close()
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOException - if an I/O error occurs.OutputStream.flush()
public void write(byte[] b,
int off,
int len)
throws IOException
len bytes from the specified byte array starting at offset off to this output stream.
write in class OutputStreamb - the data.off - the start offset in the data.len - the number of bytes to write.
IOException - if an I/O error occurs.OutputStream.write(byte[], int, int)
public void write(byte[] b)
throws IOException
b.length bytes from the specified byte array to this output stream.
write in class OutputStreamb - the data.
IOException - if an I/O error occurs.OutputStream.write(byte[])
public void write(int b)
throws IOException
write in class OutputStreamb - the byte.
IOException - if an I/O error occurs.OutputStream.write(int)public ByteBuffer toByteBuffer()
ByteBuffer.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||