Interface ByteBufferSerializer<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T fromByteBuffer​(java.nio.ByteBuffer buffer)
      Deserialize an object from a byte buffer (e.g., disk)
      int getByteSize​(T object)
      Get the size of the object in bytes.
      void toByteBuffer​(java.nio.ByteBuffer buffer, T object)
      Serialize the object to a byte array (e.g., disk)
    • Method Detail

      • fromByteBuffer

        T fromByteBuffer​(java.nio.ByteBuffer buffer)
                  throws java.io.IOException
        Deserialize an object from a byte buffer (e.g., disk)
        Parameters:
        buffer - Data array to process
        Returns:
        Deserialized object
        Throws:
        java.io.IOException - on IO errors
        java.lang.UnsupportedOperationException - When functionality not implemented or available
      • toByteBuffer

        void toByteBuffer​(java.nio.ByteBuffer buffer,
                          T object)
                   throws java.io.IOException
        Serialize the object to a byte array (e.g., disk)
        Parameters:
        buffer - Buffer to serialize to
        object - Object to serialize
        Throws:
        java.io.IOException - on IO errors
        java.lang.UnsupportedOperationException - When functionality not implemented or available
      • getByteSize

        int getByteSize​(T object)
                 throws java.io.IOException
        Get the size of the object in bytes.
        Parameters:
        object - Object to serialize
        Returns:
        maximum size in serialized form
        Throws:
        java.io.IOException - on IO errors
        java.lang.UnsupportedOperationException - When functionality not implemented or available