Interface ColumnSerializer<T>

  • Type Parameters:
    T -
    All Known Implementing Classes:
    ParameterValueColumnSerializer

    public interface ColumnSerializer<T>
    Serializes column values to byte arrays (used as part of tables) and back
    • Method Detail

      • deserialize

        T deserialize​(ByteArray array,
                      ColumnDefinition cd)
               throws IOException
        Read one column value (i.e. a cell from the stream) The enums are deserialized as shorts (it is converted to the actual type in the TableDefinition.deserialize(byte[], byte[]))
        Parameters:
        array - - array used for the input
        cd - the column definition for the involved column (can be used to look up column name or other properties to help in deserialization)
        Returns:
        the deserialized value
        Throws:
        IOException
      • serialize

        void serialize​(ByteArray array,
                       T v)
        Parameters:
        array -
        v -
      • toByteArray

        default byte[] toByteArray​(T v)
        This method serializes the value into a byte array
        Parameters:
        v -
        Returns:
        the resulting byte array
      • fromByteArray

        default T fromByteArray​(byte[] b,
                                ColumnDefinition cd)
                         throws IOException
        this method deserializes the value from a byte array
        Parameters:
        b - the input byte array
        cd - the column definition for the involved column (can be used to look up column name or other properties to help in deserialization)
        Returns:
        the deserialized value
        Throws:
        IOException