public class MessageChannelReader extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected BufferAllocator |
allocator |
protected ReadChannel |
in |
Constructor and Description |
---|
MessageChannelReader(ReadChannel in,
BufferAllocator allocator)
Construct a MessageReader to read streaming messages from an existing ReadChannel.
|
Modifier and Type | Method and Description |
---|---|
long |
bytesRead()
Get the number of bytes read from the ReadChannel.
|
void |
close()
Close the ReadChannel.
|
MessageResult |
readNext()
Read a message from the ReadChannel and return a MessageResult containing the Message
metadata and optional message body data.
|
protected ReadChannel in
protected BufferAllocator allocator
public MessageChannelReader(ReadChannel in, BufferAllocator allocator)
in
- Channel to read messages fromallocator
- BufferAllocator used to read Message body into an ArrowBuf.public MessageResult readNext() throws IOException
IOException
- on errorpublic long bytesRead()
public void close() throws IOException
close
in interface AutoCloseable
IOException
- on errorCopyright © 2024 The Apache Software Foundation. All rights reserved.