| Modifier and Type | Field and Description |
|---|---|
byte[] | contentcontent. |
int | lengthlength. |
int | offsetoffset. |
| Constructor and Description |
|---|
ReadBuffer(byte[] content,
int offset,
int length)Create a ReadBuffer for a portion of a byte array. |
| Modifier and Type | Method and Description |
|---|---|
InputStream | getInputStream()Get an InputStream for reading from this buffer. |
int | getLength()Always valid |
int | getOffset()Always valid |
OutputStream | getOutputStream()Get an OutputStream for writing to this buffer. |
void | readComplete(boolean success)Does nothing |
String | toString()toString. |
void | writeComplete(boolean success)Does nothing |
public final byte[] content
public final int length
public final int offset
public ReadBuffer(byte[] content,
int offset,
int length)content - the byte array containing the dataoffset - the start offset within the arraylength - the number of bytes from offsetpublic InputStream getInputStream()
BuffergetInputStream in interface Bufferpublic int getLength()
public int getOffset()
public OutputStream getOutputStream()
BuffergetOutputStream in interface BufferIllegalStateException - alwayspublic void readComplete(boolean success)
readComplete in interface Buffersuccess - if false, the read is considered failedpublic void writeComplete(boolean success)
writeComplete in interface Buffersuccess - if false, deletes any resources