Package com.google.api.client.http
Interface HttpContent
-
- All Superinterfaces:
StreamingContent
- All Known Implementing Classes:
AbstractHttpContent,AbstractInputStreamContent,AbstractXmlHttpContent,AtomContent,ByteArrayContent,EmptyContent,FileContent,InputStreamContent,JsonHttpContent,MockHttpContent,MultipartContent,ProtoHttpContent,UrlEncodedContent,XmlHttpContent
public interface HttpContent extends StreamingContent
Serializes HTTP request content into an output stream.Implementations don't need to be thread-safe.
- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetLength()Returns the content length or less than zero if not known.java.lang.StringgetType()Returns the content type ornullfor none.booleanretrySupported()Returns whether or not retry is supported on this content type.voidwriteTo(java.io.OutputStream out)Writes the byte content to the given output stream.
-
-
-
Method Detail
-
getLength
long getLength() throws java.io.IOExceptionReturns the content length or less than zero if not known.- Throws:
java.io.IOException
-
getType
java.lang.String getType()
Returns the content type ornullfor none.
-
retrySupported
boolean retrySupported()
Returns whether or not retry is supported on this content type.- Since:
- 1.4
-
writeTo
void writeTo(java.io.OutputStream out) throws java.io.IOExceptionDescription copied from interface:StreamingContentWrites 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.
- Specified by:
writeToin interfaceStreamingContent- Parameters:
out- output stream- Throws:
java.io.IOException
-
-