Class CompactDataOutput

All Implemented Interfaces:
Closeable, DataOutput, Flushable, AutoCloseable

public class CompactDataOutput extends DataOutputStream
Additional data output methods for compact storage of data structures.
See Also:
  • Constructor Details

    • CompactDataOutput

      public CompactDataOutput(OutputStream out)
      Creates a new CompactDataOutput instance that writes data to the specified underlying output stream
      Parameters:
      out - underlying output stream
  • Method Details

    • writeVarInt

      public void writeVarInt(int value) throws IOException
      Writes a variable length representation of an integer value that reduces the number of written bytes for small positive values. Depending on the given value 1 to 5 bytes will be written to the underlying stream.
      Parameters:
      value - value to write
      Throws:
      IOException - if thrown by the underlying stream
    • writeBooleanArray

      public void writeBooleanArray(boolean[] value) throws IOException
      Writes a boolean array. Internally a sequence of boolean values is packed into single bits.
      Parameters:
      value - boolean array
      Throws:
      IOException - if thrown by the underlying stream