public class StreamByteBuffer extends Object
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 |
|
protected static class |
StreamByteBuffer.StreamByteBufferChunk |
Constructor and description |
---|
StreamByteBuffer() |
StreamByteBuffer(int chunkSize) |
StreamByteBuffer(int chunkSize, StreamByteBuffer.ReadMode readMode) |
Type Params | Return Type | Name and description |
---|---|---|
|
protected int |
allocateSpace() |
|
public void |
clear() |
|
public InputStream |
getInputStream() |
|
public OutputStream |
getOutputStream() |
|
public StreamByteBuffer.ReadMode |
getReadMode() |
|
protected int |
prepareRead() |
|
public byte[] |
readAsByteArray() |
|
public String |
readAsString(String encoding) |
|
public String |
readAsString(Charset charset) |
|
public void |
reset() |
|
public void |
retainAfterReadingMode() |
|
public void |
setReadMode(StreamByteBuffer.ReadMode readMode) |
|
public int |
totalBytesUnread() |
|
public void |
writeTo(OutputStream target) |