public class ByteBufferOutputStream extends OutputStream
ByteBuffer. If bytes would be written that would overflow the buffer,
OutputStream.flush() is called. Subclasses can override flush to empty the buffer.| Constructor and Description |
|---|
ByteBufferOutputStream()
Creates an uninitialized stream that cannot be used until
setByteBuffer(ByteBuffer) is called. |
ByteBufferOutputStream(ByteBuffer byteBuffer) |
ByteBufferOutputStream(int bufferSize)
Creates a stream with a new non-direct buffer of the specified size.
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
getByteBuffer() |
void |
setByteBuffer(ByteBuffer byteBuffer) |
void |
write(byte[] bytes,
int offset,
int length) |
void |
write(int b) |
close, flush, writepublic ByteBufferOutputStream()
setByteBuffer(ByteBuffer) is called.public ByteBufferOutputStream(int bufferSize)
public ByteBufferOutputStream(ByteBuffer byteBuffer)
public ByteBuffer getByteBuffer()
public void setByteBuffer(ByteBuffer byteBuffer)
public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] bytes,
int offset,
int length)
throws IOException
write in class OutputStreamIOExceptionCopyright © 2023. All rights reserved.