public class ByteBufferByteStreamWriter extends java.lang.Object implements ByteStreamWriter
ByteStreamWriter that writes a java.nio.ByteBuffer to a byte array
parameter.ByteStreamWriter.ByteStreamTarget| Constructor and Description |
|---|
ByteBufferByteStreamWriter(java.nio.ByteBuffer buf)
Construct the writer with the given
ByteBuffer |
| Modifier and Type | Method and Description |
|---|---|
int |
getLength()
Returns the length of the stream.
|
void |
writeTo(ByteStreamWriter.ByteStreamTarget target)
Write the data to the provided
OutputStream. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitofpublic ByteBufferByteStreamWriter(java.nio.ByteBuffer buf)
ByteBufferbuf - the buffer to use.public int getLength()
ByteStreamWriterThis must be known ahead of calling ByteStreamWriter.writeTo(ByteStreamTarget).
getLength in interface ByteStreamWriterpublic void writeTo(ByteStreamWriter.ByteStreamTarget target) throws java.io.IOException
ByteStreamWriterOutputStream.
Should not write more than ByteStreamWriter.getLength() bytes. If attempted, the provided stream
will throw an IOException.
writeTo in interface ByteStreamWritertarget - the stream to write the data tojava.io.IOException - if the underlying stream throws or there is some other error.Copyright © 2025 PostgreSQL Global Development Group. All rights reserved.