com.google.api.client.http
Interface HttpContent

All Known Implementing Classes:
AbstractHttpContent, AbstractInputStreamContent, AbstractXmlHttpContent, AtomContent, ByteArrayContent, FileContent, InputStreamContent, JsonHttpContent, MockHttpContent, MultipartRelatedContent, ProtoHttpContent, UrlEncodedContent, XmlHttpContent

public interface HttpContent

Serializes HTTP request content into an output stream.

Implementations don't need to be thread-safe.

Since:
1.0
Author:
Yaniv Inbar

Method Summary
 String getEncoding()
          Returns the content encoding (for example "gzip") or null for none.
 long getLength()
          Returns the content length or less than zero if not known.
 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(OutputStream out)
          Writes the content to the given output stream.
 

Method Detail

getLength

long getLength()
               throws IOException
Returns the content length or less than zero if not known.

Throws:
IOException

getEncoding

String getEncoding()
Returns the content encoding (for example "gzip") or null for none.


getType

String getType()
Returns the content type or null for none.


writeTo

void writeTo(OutputStream out)
             throws IOException
Writes the content to the given output stream.

The recommendation for implementations is that they should not close the output stream. Callers should not assume whether or not the output stream has been closed. Implementations that do not close the output stream should flush it at the end of the method.

Throws:
IOException

retrySupported

boolean retrySupported()
Returns whether or not retry is supported on this content type.

Since:
1.4


Copyright © 2011-2012 Google. All Rights Reserved.