public class ByteArrayRequestBodyWriter extends java.lang.Object implements RequestBodyWriter
Modifier and Type | Field and Description |
---|---|
protected byte[] |
content
The content.
|
protected int |
pos
The position within the content at which the next read will occur.
|
Constructor and Description |
---|
ByteArrayRequestBodyWriter(byte[] content)
Constructs a new byte array request body writer with the specified
content.
|
Modifier and Type | Method and Description |
---|---|
long |
getContentLength()
Returns the total number of bytes that will be written in a single pass
by this writer.
|
void |
reset()
Initialises the writer.
|
int |
write(byte[] buffer)
Writes body content to the supplied buffer.
|
protected byte[] content
protected int pos
public ByteArrayRequestBodyWriter(byte[] content)
content
- the content bufferpublic long getContentLength()
getContentLength
in interface RequestBodyWriter
public void reset()
reset
in interface RequestBodyWriter
public int write(byte[] buffer)
write
in interface RequestBodyWriter
buffer
- the content buffer