public interface HttpContent extends StreamingContent
Implementations don't need to be thread-safe.
Modifier and Type | Method and Description |
---|---|
long |
getLength()
Returns the content length or less than zero if not known.
|
java.lang.String |
getType()
Returns the content type or
null for none. |
boolean |
retrySupported()
Returns whether or not retry is supported on this content type.
|
void |
writeTo(java.io.OutputStream out)
Writes the byte content to the given output stream.
|
long getLength() throws java.io.IOException
java.io.IOException
java.lang.String getType()
null
for none.boolean retrySupported()
void writeTo(java.io.OutputStream out) throws java.io.IOException
StreamingContent
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.
writeTo
in interface StreamingContent
out
- output streamjava.io.IOException
Copyright © 2011-2018 Google. All Rights Reserved.