Interface DatatypeCodec<T>

    • Method Detail

      • encode

        void encode​(T value,
                    DataOutput out,
                    EncoderUtils utils)
             throws IOException

        Encode the specified value to the given data output stream.

        Parameters:
        value - the value to encode. This will never be null.
        out - the data output stream to encode the value to.
        utils - additional utility encoding functions that may be useful to the codec.
        Throws:
        IOException - if an I/O error occurs.
        Since:
        Rhino 2.4.0
      • decode

        T decode​(DataInput in,
                 ClassLoader cl,
                 DecoderUtils utils)
          throws IOException

        Decode a value from the given data input stream.

        Parameters:
        in - the data input stream to decode the value from.
        cl - a classloader which can be used to load classes necessary to decode the value.
        utils - additional utility decoding functions that may be useful to the codec.
        Returns:
        the decoded value.
        Throws:
        IOException - if an I/O error occurs.
        Since:
        Rhino 2.4.0