Package com.parse.http
Class ParseHttpBody
- java.lang.Object
-
- com.parse.http.ParseHttpBody
-
public abstract class ParseHttpBody extends java.lang.ObjectThe base interface of a http body. It can be implemented by different http libraries such as Apache http, Android URLConnection, Square OKHttp and so on.
-
-
Constructor Summary
Constructors Constructor Description ParseHttpBody(java.lang.String contentType, long contentLength)Creates anParseHttpBodywith givenContent-TypeandContent-Length.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.io.InputStreamgetContent()Returns the content of this body.longgetContentLength()Returns the number of bytes which will be written tooutwhenwriteTo(java.io.OutputStream)is called, or-1if that count is unknown.java.lang.StringgetContentType()Returns theContent-Typeof this body.abstract voidwriteTo(java.io.OutputStream out)Writes the content of this request toout.
-
-
-
Method Detail
-
getContent
public abstract java.io.InputStream getContent() throws java.io.IOExceptionReturns the content of this body.- Returns:
- The content of this body.
- Throws:
java.io.IOException- Throws an exception if the content of this body is inaccessible.
-
writeTo
public abstract void writeTo(java.io.OutputStream out) throws java.io.IOExceptionWrites the content of this request toout.- Parameters:
out- The outputStream the content of this body needs to be written to.- Throws:
java.io.IOException- Throws an exception if the content of this body can not be written toout.
-
getContentLength
public long getContentLength()
Returns the number of bytes which will be written tooutwhenwriteTo(java.io.OutputStream)is called, or-1if that count is unknown.- Returns:
- The Content-Length of this body.
-
getContentType
public java.lang.String getContentType()
Returns theContent-Typeof this body.- Returns:
- The
Content-Typeof this body.
-
-