Interface Deserializer<T>

Type Parameters:
T - The type of objects that can be deserialized.
All Known Subinterfaces:
SerializerDeserializer<T>
All Known Implementing Classes:
ByteArraySerializer, StringSerializer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Deserializer<T>
Deserialize objects from Buffer to Deserializer.
  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(Buffer serializedData, BufferAllocator allocator)
    Deserialize the contents from the Buffer parameter.
  • Method Details

    • deserialize

      T deserialize(Buffer serializedData, BufferAllocator allocator)
      Deserialize the contents from the Buffer parameter.

      The caller is responsible for assuming the buffer contents contains enough Buffer.readableBytes() to successfully deserialize.

      Parameters:
      serializedData - Buffer whose Buffer.readableBytes() contains a serialized object. The Buffer.readerIndex() will be advanced to indicate the content which has been consumed.
      allocator - Used to allocate intermediate Buffers if required.
      Returns:
      The result of the deserialization.