Class EncodingOptions


  • public class EncodingOptions
    extends Object
    Serialization metadata to allow for evolution of the encoding used for property storage. This info is expected to be stored first in the serialization and uncompressed so that the handling of subsequent fields and data can be processed correctly and without additional processing.

    Instances of this class are immutable.

    • Method Detail

      • V1_0

        public static EncodingOptions V1_0​(boolean compress)
        Instantiate encoding options to use version 1.0 encoding settings.
        Parameters:
        compress - when true compress the property map.
        Returns:
        the encoding options.
      • fromDataStream

        public static EncodingOptions fromDataStream​(DataInputStream dis)
                                              throws IOException
        Instantiate an instance of EncodingOptions reading the values from an input stream. Typically, the stream will be obtained from reading a byte array from a data store and then creating a stream that reads from that array,
        Parameters:
        dis - a data input stream
        Throws:
        IOException - if an exception occurs reading from the input stream.
      • encode

        public void encode​(DataOutputStream dos)
                    throws IOException
        Write the values to a data stream.
        Parameters:
        dos - a data output stream
        Throws:
        IOException - if an exception occurs writing the data stream.
      • getEncodingVersion

        public int getEncodingVersion()
        get the encoding version of the instance,
        Returns:
        the encoding version
      • isCompressed

        public boolean isCompressed()
        get if the compress is set.
        Returns:
        true if the payload is compressed, false if not.