public final class HttpEncodingStreamingContent extends Object implements StreamingContent
Implementation is thread-safe only if the streaming content and HTTP encoding are thread-safe.
Constructor and Description |
---|
HttpEncodingStreamingContent(StreamingContent content,
HttpEncoding encoding) |
Modifier and Type | Method and Description |
---|---|
StreamingContent |
getContent()
Returns the streaming content.
|
HttpEncoding |
getEncoding()
Returns the HTTP encoding.
|
void |
writeTo(OutputStream out)
Writes the byte content to the given output stream.
|
public HttpEncodingStreamingContent(StreamingContent content, HttpEncoding encoding)
content
- streaming contentencoding
- HTTP encodingpublic void writeTo(OutputStream out) throws IOException
StreamingContent
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.
writeTo
in interface StreamingContent
out
- output streamIOException
public StreamingContent getContent()
public HttpEncoding getEncoding()
Copyright © 2011–2022 Google. All rights reserved.