gnu.inet.http
Class ByteArrayRequestBodyWriter
java.lang.Object
gnu.inet.http.ByteArrayRequestBodyWriter
- RequestBodyWriter
public class ByteArrayRequestBodyWriter
extends java.lang.Object
A simple request body writer using a byte array.
protected byte[] | content - The content.
|
protected int | pos - The position within the content at which the next read will occur.
|
int | 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.
|
content
protected byte[] content
The content.
pos
protected int pos
The position within the content at which the next read will occur.
ByteArrayRequestBodyWriter
public ByteArrayRequestBodyWriter(byte[] content)
Constructs a new byte array request body writer with the specified
content.
content
- the content buffer
getContentLength
public int getContentLength()
Returns the total number of bytes that will be written in a single pass
by this writer.
- getContentLength in interface RequestBodyWriter
reset
public void reset()
Initialises the writer.
This will be called before each pass.
- reset in interface RequestBodyWriter
write
public int write(byte[] buffer)
Writes body content to the supplied buffer.
- write in interface RequestBodyWriter
buffer
- the content buffer
- the number of bytes written