public class BodyReferenceImpl extends Object implements Parser.BodyReference
Constructor and Description |
---|
BodyReferenceImpl() |
BodyReferenceImpl(long length,
Charset charset,
File file,
InputStream in) |
Modifier and Type | Method and Description |
---|---|
byte[] |
bytes()
Returns the HTTP body as a byte array.
|
long |
length() |
String |
text()
Returns the HTTP body as text.
|
void |
writeTo(OutputStream output)
Write the content to the given output stream.
|
public BodyReferenceImpl(long length, Charset charset, File file, InputStream in) throws IOException
IOException
public BodyReferenceImpl()
public long length()
length
in interface Parser.BodyReference
public byte[] bytes() throws IOException
Parser.BodyReference
bytes
in interface Parser.BodyReference
IOException
- If reading fails.public String text() throws IOException
Parser.BodyReference
text
in interface Parser.BodyReference
IOException
- If reading fails.public void writeTo(OutputStream output) throws IOException
Parser.BodyReference
OutputStream
.writeTo
in interface Parser.BodyReference
output
- An output stream.IOException
Copyright © 2016. All rights reserved.