public class WriteChannel extends Object implements AutoCloseable
All write methods in this class follow full write semantics, i.e., write calls only return after requested data has been fully written. Note this is different from java WritableByteChannel interface where partial write is allowed
Please note that objects of this class are not thread-safe.
| Constructor and Description |
|---|
WriteChannel(WritableByteChannel out) |
| Modifier and Type | Method and Description |
|---|---|
long |
align()
Writes enough bytes to align the channel to an 8-byte boundary.
|
void |
close() |
long |
getCurrentPosition() |
static ByteBuffer |
serialize(FBSerializable writer)
Serializes writer to a ByteBuffer.
|
void |
write(ArrowBuf buffer)
Writes the buffer to the underlying channel.
|
long |
write(byte[] buffer) |
long |
write(ByteBuffer buffer)
Writes all data from
buffer to the underlying channel. |
long |
write(FBSerializable writer,
boolean withSizePrefix)
Writes the serialized flatbuffer to the underlying channel.
|
long |
writeIntLittleEndian(int v)
Writes
v in little-endian format to the underlying channel. |
long |
writeZeros(long zeroCount)
Writes
|
public WriteChannel(WritableByteChannel out)
public void close()
throws IOException
close in interface AutoCloseableIOExceptionpublic long getCurrentPosition()
public long write(byte[] buffer)
throws IOException
IOExceptionpublic long writeZeros(long zeroCount)
throws IOException
IOExceptionpublic long align()
throws IOException
IOExceptionpublic long write(ByteBuffer buffer) throws IOException
buffer to the underlying channel.IOExceptionpublic long writeIntLittleEndian(int v)
throws IOException
v in little-endian format to the underlying channel.IOExceptionpublic void write(ArrowBuf buffer) throws IOException
IOExceptionpublic long write(FBSerializable writer, boolean withSizePrefix) throws IOException
IOExceptionpublic static ByteBuffer serialize(FBSerializable writer)
Copyright © 2024 The Apache Software Foundation. All rights reserved.