public abstract class ParseHttpBody extends Object
Constructor and Description |
---|
ParseHttpBody(String contentType,
long contentLength)
Creates an
ParseHttpBody with given Content-Type and Content-Length . |
Modifier and Type | Method and Description |
---|---|
abstract InputStream |
getContent()
Returns the content of this body.
|
long |
getContentLength()
Returns the number of bytes which will be written to
out when ParseHttpBody.writeTo(java.io.OutputStream) is
called, or -1 if that count is unknown. |
String |
getContentType()
Returns the
Content-Type of this body. |
abstract void |
writeTo(OutputStream out)
Writes the content of this request to
out . |
public ParseHttpBody(String contentType, long contentLength)
ParseHttpBody
with given Content-Type
and Content-Length
.contentType
- The Content-Type
of the ParseHttpBody
.contentLength
- The Content-Length
of the ParseHttpBody
.public abstract InputStream getContent() throws IOException
IOException
- Throws an exception if the content of this body is inaccessible.public abstract void writeTo(OutputStream out) throws IOException
out
.out
- The outputStream the content of this body needs to be written to.IOException
- Throws an exception if the content of this body can not be written to out
.public long getContentLength()
out
when ParseHttpBody.writeTo(java.io.OutputStream)
is
called, or -1
if that count is unknown.public String getContentType()
Content-Type
of this body.Content-Type
of this body.