Package io.servicetalk.serializer.api
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.
Deserialize objects from
Buffer
to Deserializer
.-
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(Buffer serializedData, BufferAllocator allocator) Deserialize the contents from theBuffer
parameter.
-
Method Details
-
deserialize
Deserialize the contents from theBuffer
parameter.The caller is responsible for assuming the buffer contents contains enough
Buffer.readableBytes()
to successfully deserialize.- Parameters:
serializedData
-Buffer
whoseBuffer.readableBytes()
contains a serialized object. TheBuffer.readerIndex()
will be advanced to indicate the content which has been consumed.allocator
- Used to allocate intermediateBuffer
s if required.- Returns:
- The result of the deserialization.
-