Package io.servicetalk.http.api
Interface HttpStreamingSerializer<T>
- Type Parameters:
T- The type of objects to serialize.
- All Known Subinterfaces:
HttpStreamingSerializerDeserializer<T>
public interface HttpStreamingSerializer<T>
HTTP request/response serialization for streaming payload bodies.
-
Method Summary
Modifier and TypeMethodDescriptionserialize(HttpHeaders headers, Publisher<T> value, BufferAllocator allocator) default BlockingIterable<Buffer>serialize(HttpHeaders headers, BlockingIterable<T> value, BufferAllocator allocator) Serialize anBlockingIterableof typeHttpStreamingSerializerinto anBlockingIterableof typeBuffer.serialize(HttpHeaders headers, HttpPayloadWriter<Buffer> payloadWriter, BufferAllocator allocator) Returns anHttpPayloadWriterof typeHttpStreamingSerializerwhich serializes eachwritten objectinto aBuffer.
-
Method Details
-
serialize
Serialize aPublisherof typeHttpStreamingSerializerinto aPublisherof typeBuffer. If necessary theHttpHeadersshould be updated to indicate the content-type.- Parameters:
headers- TheHttpHeadersassociated with the serialization operation.value- The objects to serialize.allocator- TheBufferAllocatorused to create the resultingBuffers.- Returns:
- The result of the serialization operation.
-
serialize
default BlockingIterable<Buffer> serialize(HttpHeaders headers, BlockingIterable<T> value, BufferAllocator allocator) Serialize anBlockingIterableof typeHttpStreamingSerializerinto anBlockingIterableof typeBuffer. If necessary theHttpHeadersshould be updated to indicate the content-type.- Parameters:
headers- TheHttpHeadersassociated with the serialization operation.value- The objects to serialize.allocator- TheBufferAllocatorused to create the resultingBuffers.- Returns:
- The result of the serialization operation.
-
serialize
HttpPayloadWriter<T> serialize(HttpHeaders headers, HttpPayloadWriter<Buffer> payloadWriter, BufferAllocator allocator) Returns anHttpPayloadWriterof typeHttpStreamingSerializerwhich serializes eachwritten objectinto aBuffer. If necessary theHttpHeadersshould be updated to indicate the content-type.- Parameters:
headers- TheHttpHeadersassociated with the serialization operation.payloadWriter- TheHttpPayloadWriterwhich writes serializedBuffers.allocator- TheBufferAllocatorused to create the resultingBuffers.- Returns:
- The
HttpPayloadWriterof typeHttpStreamingSerializerwith embedded serialization into aBuffer.
-