Interface MetadataReader

All Known Implementing Classes:
DecodingContext

public interface MetadataReader
Reads stage metadata values from a buffer during decoding.

This is the decode-side counterpart of MetadataWriter. See that interface for the rationale behind using a dedicated interface rather than Lucene's DataInput or Elasticsearch's StreamInput.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    Reads a single byte.
    default void
    readBytes(byte[] bytes)
    Reads bytes into the given array starting at offset 0.
    void
    readBytes(byte[] bytes, int offset, int length)
    Reads bytes into the given array.
    int
    Reads a fixed 4-byte integer in Lucene format.
    long
    Reads a fixed 8-byte long in Lucene format.
    int
    Reads a variable-length integer.
    long
    Reads a variable-length long.
    int
    Reads a zigzag-encoded variable-length integer.
    long
    Reads a zigzag-encoded variable-length long.
  • Method Details

    • readByte

      byte readByte() throws IOException
      Reads a single byte.
      Returns:
      the byte value
      Throws:
      IOException - if an I/O error occurs
    • readZInt

      int readZInt() throws IOException
      Reads a zigzag-encoded variable-length integer.
      Returns:
      the decoded integer
      Throws:
      IOException - if an I/O error occurs
    • readZLong

      long readZLong() throws IOException
      Reads a zigzag-encoded variable-length long.
      Returns:
      the decoded long
      Throws:
      IOException - if an I/O error occurs
    • readLong

      long readLong() throws IOException
      Reads a fixed 8-byte long in Lucene format.
      Returns:
      the long value
      Throws:
      IOException - if an I/O error occurs
    • readInt

      int readInt() throws IOException
      Reads a fixed 4-byte integer in Lucene format.
      Returns:
      the integer value
      Throws:
      IOException - if an I/O error occurs
    • readVInt

      int readVInt() throws IOException
      Reads a variable-length integer.
      Returns:
      the decoded integer
      Throws:
      IOException - if an I/O error occurs
    • readVLong

      long readVLong() throws IOException
      Reads a variable-length long.
      Returns:
      the decoded long
      Throws:
      IOException - if an I/O error occurs
    • readBytes

      void readBytes(byte[] bytes, int offset, int length) throws IOException
      Reads bytes into the given array.
      Parameters:
      bytes - the destination array
      offset - the offset in the array
      length - the number of bytes to read
      Throws:
      IOException - if an I/O error occurs
    • readBytes

      default void readBytes(byte[] bytes) throws IOException
      Reads bytes into the given array starting at offset 0.
      Parameters:
      bytes - the destination array
      Throws:
      IOException - if an I/O error occurs