Module org.elasticsearch.server
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 TypeMethodDescriptionbytereadByte()Reads a single byte.default voidreadBytes(byte[] bytes) Reads bytes into the given array starting at offset 0.voidreadBytes(byte[] bytes, int offset, int length) Reads bytes into the given array.intreadInt()Reads a fixed 4-byte integer in Lucene format.longreadLong()Reads a fixed 8-byte long in Lucene format.intreadVInt()Reads a variable-length integer.longReads a variable-length long.intreadZInt()Reads a zigzag-encoded variable-length integer.longReads a zigzag-encoded variable-length long.
-
Method Details
-
readByte
Reads a single byte.- Returns:
- the byte value
- Throws:
IOException- if an I/O error occurs
-
readZInt
Reads a zigzag-encoded variable-length integer.- Returns:
- the decoded integer
- Throws:
IOException- if an I/O error occurs
-
readZLong
Reads a zigzag-encoded variable-length long.- Returns:
- the decoded long
- Throws:
IOException- if an I/O error occurs
-
readLong
Reads a fixed 8-byte long in Lucene format.- Returns:
- the long value
- Throws:
IOException- if an I/O error occurs
-
readInt
Reads a fixed 4-byte integer in Lucene format.- Returns:
- the integer value
- Throws:
IOException- if an I/O error occurs
-
readVInt
Reads a variable-length integer.- Returns:
- the decoded integer
- Throws:
IOException- if an I/O error occurs
-
readVLong
Reads a variable-length long.- Returns:
- the decoded long
- Throws:
IOException- if an I/O error occurs
-
readBytes
Reads bytes into the given array.- Parameters:
bytes- the destination arrayoffset- the offset in the arraylength- the number of bytes to read- Throws:
IOException- if an I/O error occurs
-
readBytes
Reads bytes into the given array starting at offset 0.- Parameters:
bytes- the destination array- Throws:
IOException- if an I/O error occurs
-