Interface StagedSerde<T>

    • Method Detail

      • serializeDelayed

        StorableBuffer serializeDelayed​(@Nullable
                                        T value)
        Useful method when some computation is necessary to prepare for serialization without actually writing out all the bytes in order to determine the serialized size. It allows encapsulation of the size computation and the final logical to actually store into a ByteBuffer. It also allows for callers to pack multiple serialized objects into a single ByteBuffer without extra copies of a byte[]/ByteBuffer by using the StorableBuffer instance returned
        Parameters:
        value - - object to serialize
        Returns:
        an object that reports its serialized size and how to serialize the object to a ByteBuffer
      • serialize

        default byte[] serialize​(T value)
        Default implementation for when a byte[] is desired. Typically, this default should suffice. Implementing serializeDelayed() includes the logic of how to store into a ByteBuffer
        Parameters:
        value - - object to serialize
        Returns:
        serialized byte[] of value
      • deserialize

        default T deserialize​(byte[] bytes)