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 aPublisher
ofStreamingSerializer
.allocator
- theBufferAllocator
to use if allocation is required.- Returns:
- the serialized stream of data represented in a
Publisher
ofBuffer
.
-
serialize
- Parameters:
toSerialize
- the deserialized stream of data represented in aIterable
ofStreamingSerializer
.allocator
- theBufferAllocator
to use if allocation is required.- Returns:
- the serialized stream of data represented in a
Iterable
ofBuffer
.
-
serialize
- Parameters:
writer
- ThePayloadWriter
used to write the result of serialization to.allocator
- theBufferAllocator
to use if allocation is required.- Returns:
- a
PayloadWriter
where you can writeStreamingSerializer
s to.
-