Package io.servicetalk.serializer.api
Interface StreamingSerializer<T>
- Type Parameters:
T- The type of objects that can be serialized.
- All Known Subinterfaces:
StreamingSerializerDeserializer<T>
- All Known Implementing Classes:
FixedLengthStreamingSerializer,VarIntLengthStreamingSerializer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionserialize(Publisher<T> toSerialize, BufferAllocator allocator) default PayloadWriter<T>serialize(PayloadWriter<Buffer> writer, BufferAllocator allocator) default BlockingIterable<Buffer>serialize(Iterable<T> toSerialize, BufferAllocator allocator)
-
Method Details
-
serialize
- Parameters:
toSerialize- the deserialized stream of data represented in aPublisherofStreamingSerializer.allocator- theBufferAllocatorto use if allocation is required.- Returns:
- the serialized stream of data represented in a
PublisherofBuffer.
-
serialize
- Parameters:
toSerialize- the deserialized stream of data represented in aIterableofStreamingSerializer.allocator- theBufferAllocatorto use if allocation is required.- Returns:
- the serialized stream of data represented in a
IterableofBuffer.
-
serialize
- Parameters:
writer- ThePayloadWriterused to write the result of serialization to.allocator- theBufferAllocatorto use if allocation is required.- Returns:
- a
PayloadWriterwhere you can writeStreamingSerializers to.
-