Class MessageMetadataResult
java.lang.Object
org.apache.arrow.vector.ipc.message.MessageMetadataResult
Class to hold resulting Message metadata and buffer containing the serialized Flatbuffer message
when reading messages from a ReadChannel. This handles Message metadata only and does not include
the message body data, which should be subsequently read into an ArrowBuf.
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the bytes remaining in the buffer after parsing the message from it.static MessageMetadataResult
create
(ByteBuffer buffer, int messageLength) Creates a newMessageMetadataResult
by parsing it from the beginning of the buffer.Get the realized flatbuf Message metadata description.long
Get the length of the message body.Get the buffer containing the raw message metadata bytes, not including the message body data.int
Get the length of the message metadata in bytes, not including the body length.byte
boolean
Check if the message is followed by a body.
-
Method Details
-
create
Creates a newMessageMetadataResult
by parsing it from the beginning of the buffer.- Parameters:
messageLength
- The length of the serialized flatbuffer message in bytes (might not be equal to the buffer size).
-
getMessageLength
public int getMessageLength()Get the length of the message metadata in bytes, not including the body length.- Returns:
- number of bytes in the message metadata buffer.
-
getMessageBuffer
Get the buffer containing the raw message metadata bytes, not including the message body data.- Returns:
- buffer containing the message metadata.
-
bytesAfterMessage
public int bytesAfterMessage()Returns the bytes remaining in the buffer after parsing the message from it. -
headerType
public byte headerType() -
messageHasBody
public boolean messageHasBody()Check if the message is followed by a body. This will be true if the message has a body length > 0, which indicates that a message body needs to be read from the input source.- Returns:
- true if message has a defined body
-
getMessageBodyLength
public long getMessageBodyLength()Get the length of the message body.- Returns:
- number of bytes of the message body
-
getMessage
Get the realized flatbuf Message metadata description.- Returns:
- Message metadata
-