Class HttpEncodingStreamingContent (1.41.8)

public final class HttpEncodingStreamingContent implements StreamingContent

Streaming content based on an HTTP encoding.

Implementation is thread-safe only if the streaming content and HTTP encoding are thread-safe.

Inheritance

java.lang.Object > HttpEncodingStreamingContent

Implements

StreamingContent

Constructors

HttpEncodingStreamingContent(StreamingContent content, HttpEncoding encoding)

public HttpEncodingStreamingContent(StreamingContent content, HttpEncoding encoding)
Parameters
NameDescription
contentStreamingContent

streaming content

encodingHttpEncoding

HTTP encoding

Methods

getContent()

public StreamingContent getContent()

Returns the streaming content.

Returns
TypeDescription
StreamingContent

getEncoding()

public HttpEncoding getEncoding()

Returns the HTTP encoding.

Returns
TypeDescription
HttpEncoding

writeTo(OutputStream out)

public void writeTo(OutputStream out)

Writes the byte content to the given output stream.

Implementations must not close the output stream, and instead should flush the output stream. Some callers may assume that the output stream has not been closed, and will fail to work if it has been closed.

Parameter
NameDescription
outOutputStream
Exceptions
TypeDescription
IOException