|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Buffer
The Buffer
interface represents a collection of bytes
that can be written to and later read. This is used to provide a
region of memory is such a way that the underlying representation
of that memory is independent of its use. Typically buffers are
implemented as either allocated byte arrays or files.
Allocator
Method Summary | |
---|---|
Buffer |
allocate()
This method is used to allocate a segment of this buffer as a separate buffer object. |
Buffer |
append(byte[] array)
This method is used to append bytes to the end of the buffer. |
Buffer |
append(byte[] array,
int off,
int len)
This method is used to append bytes to the end of the buffer. |
void |
clear()
This will clear all data from the buffer. |
void |
close()
This method is used to ensure the buffer can be closed. |
java.lang.String |
encode()
This method is used to acquire the buffered bytes as a string. |
java.lang.String |
encode(java.lang.String charset)
This method is used to acquire the buffered bytes as a string. |
Methods inherited from interface org.simpleframework.util.buffer.Stream |
---|
getInputStream |
Method Detail |
---|
Buffer allocate() throws java.io.IOException
java.io.IOException
java.lang.String encode() throws java.io.IOException
java.io.IOException
java.lang.String encode(java.lang.String charset) throws java.io.IOException
charset
- this is the charset to encode the data with
java.io.IOException
Buffer append(byte[] array) throws java.io.IOException
array
- this is the byte array to append to this buffer
java.io.IOException
Buffer append(byte[] array, int off, int len) throws java.io.IOException
array
- this is the byte array to append to this bufferlen
- the number of bytes to be read from the arrayoff
- this is the offset to begin reading the bytes from
java.io.IOException
void clear() throws java.io.IOException
java.io.IOException
void close() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |