uka.transport
Class MemoryOutputStream
java.lang.Object
java.io.OutputStream
uka.transport.MemoryOutputStream
- public final class MemoryOutputStream
- extends java.io.OutputStream
An output stream that writes into memory.
- Author:
- Bernhard Haumacher
|
Field Summary |
private byte[] |
buffer
|
private int |
count
number of valid byte in the buffer |
| Methods inherited from class java.io.OutputStream |
close, flush |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
buffer
private byte[] buffer
count
private int count
- number of valid byte in the buffer
MemoryOutputStream
public MemoryOutputStream()
- Create the stream with a default buffer size of 512 bytes.
MemoryOutputStream
public MemoryOutputStream(int size)
write
public void write(int b)
write
public void write(byte[] b)
write
public void write(byte[] b,
int off,
int len)
reset
public void reset()
size
public int size()
getBuffer
public byte[] getBuffer()