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
Serializes HTTP request content into an output stream.
Implementations don't need to be thread-safe.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the content length or less than zero if not known.getType()
Returns the content type ornull
for none.boolean
Returns whether or not retry is supported on this content type.void
writeTo
(OutputStream out) Writes the byte content to the given output stream.
-
Method Details
-
getLength
Returns the content length or less than zero if not known.- Throws:
IOException
-
getType
String getType()Returns the content type ornull
for none. -
retrySupported
boolean retrySupported()Returns whether or not retry is supported on this content type.- Since:
- 1.4
-
writeTo
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 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
-