Interface IntSerializer

All Known Implementing Classes:
IndexSerializer

public interface IntSerializer
Writes/reads an integer to/from a binary stream.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Read an integer from the specified input stream.
    default int
    size(int value)
    Returns the serialized size of the specified value.
    default void
    writeInt(DataOutput output, int value)
    Writes the specified integer to the specified output stream
  • Method Details

    • writeInt

      default void writeInt(DataOutput output, int value) throws IOException
      Writes the specified integer to the specified output stream
      Parameters:
      output - the data output stream
      value - an integer value
      Throws:
      IOException - if an I/O error occurs
    • readInt

      default int readInt(DataInput input) throws IOException
      Read an integer from the specified input stream.
      Parameters:
      input - a data input stream
      Returns:
      the integer value
      Throws:
      IOException - if an I/O error occurs
    • size

      default int size(int value)
      Returns the serialized size of the specified value.
      Parameters:
      value - a numeric value
      Returns:
      the serialized size of the specified value.