Package com.google.api.client.http
Class HttpEncodingStreamingContent
- java.lang.Object
-
- com.google.api.client.http.HttpEncodingStreamingContent
-
- All Implemented Interfaces:
StreamingContent
public final class HttpEncodingStreamingContent extends Object implements StreamingContent
Streaming content based on an HTTP encoding.Implementation is thread-safe only if the streaming content and HTTP encoding are thread-safe.
- Since:
- 1.14
- Author:
- Yaniv Inbar
-
-
Constructor Summary
Constructors Constructor Description HttpEncodingStreamingContent(StreamingContent content, HttpEncoding encoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
HttpEncodingStreamingContent
public HttpEncodingStreamingContent(StreamingContent content, HttpEncoding encoding)
- Parameters:
content
- streaming contentencoding
- HTTP encoding
-
-
Method Detail
-
writeTo
public void writeTo(OutputStream out) throws IOException
Description copied from interface:StreamingContent
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 the output stream has not been closed, and will fail to work if it has been closed.
- Specified by:
writeTo
in interfaceStreamingContent
- Parameters:
out
- output stream- Throws:
IOException
-
getContent
public StreamingContent getContent()
Returns the streaming content.
-
getEncoding
public HttpEncoding getEncoding()
Returns the HTTP encoding.
-
-