An in-memory buffer that provides OutputStream and InputStream interfaces. This is more efficient than using ByteArrayOutputStream/ByteArrayInputStream This is not thread-safe, it is intended to be used by a single Thread.
Modifiers | Name | Description |
---|---|---|
enum |
StreamByteBuffer.ReadMode |
Constructor and description |
---|
StreamByteBuffer
() An in-memory buffer that provides OutputStream and InputStream interfaces. |
StreamByteBuffer
(int chunkSize) |
StreamByteBuffer
(int chunkSize, StreamByteBuffer.ReadMode readMode) |
Type | Name and description |
---|---|
protected int |
allocateSpace() |
void |
clear() |
java.io.InputStream |
getInputStream() |
java.io.OutputStream |
getOutputStream() |
StreamByteBuffer.ReadMode |
getReadMode() |
protected int |
prepareRead() |
byte[] |
readAsByteArray() |
java.lang.String |
readAsString(java.lang.String encoding) |
java.lang.String |
readAsString(java.nio.charset.Charset charset) |
void |
reset() |
void |
retainAfterReadingMode() |
void |
setReadMode(StreamByteBuffer.ReadMode readMode) |
int |
totalBytesUnread() |
void |
writeTo(java.io.OutputStream target) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
An in-memory buffer that provides OutputStream and InputStream interfaces. This is more efficient than using ByteArrayOutputStream/ByteArrayInputStream This is not thread-safe, it is intended to be used by a single Thread.