Class MessageMetadataResult

java.lang.Object
org.apache.arrow.vector.ipc.message.MessageMetadataResult

public class MessageMetadataResult extends Object
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 Details

    • create

      public static MessageMetadataResult create(ByteBuffer buffer, int messageLength)
      Creates a new MessageMetadataResult 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

      public ByteBuffer 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

      public Message getMessage()
      Get the realized flatbuf Message metadata description.
      Returns:
      Message metadata