|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.http.AbstractHttpContent
public abstract class AbstractHttpContent
Abstract implementation of an HTTP content with typical options.
Implementation is not thread-safe.
Constructor Summary | |
---|---|
AbstractHttpContent()
|
Method Summary | |
---|---|
protected long |
computeLength()
Computes and returns the content length or less than zero if not known. |
String |
getEncoding()
Default implementation returns null , but subclasses may override. |
long |
getLength()
Default implementation calls computeLength() once and caches it for future
invocations, but subclasses may override. |
boolean |
retrySupported()
Default implementation returns true , but subclasses may override. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.google.api.client.http.HttpContent |
---|
getType, writeTo |
Constructor Detail |
---|
public AbstractHttpContent()
Method Detail |
---|
public String getEncoding()
null
, but subclasses may override.
getEncoding
in interface HttpContent
public long getLength() throws IOException
computeLength()
once and caches it for future
invocations, but subclasses may override.
getLength
in interface HttpContent
IOException
protected long computeLength() throws IOException
Subclasses may override, but by default this computes the length by calling
HttpContent.writeTo(OutputStream)
with an output stream that does not process the bytes written,
but only retains the count of bytes. If retrySupported()
is false
, it will
instead return -1
.
IOException
public boolean retrySupported()
true
, but subclasses may override.
retrySupported
in interface HttpContent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |