com.evanmclean.evlib.io
Class ByteArrayInputOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
com.evanmclean.evlib.io.ByteArrayInputOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class ByteArrayInputOutputStream
- extends ByteArrayOutputStream
A byte array output stream which you can then directly get an input stream
for without the overhead of copying the byte array. Input stream behaviour
may get screwy if you write to the output stream, and particularly if you
call ByteArrayOutputStream.reset()
after calling getInputStream()
.
ByteArrayInputOutputStream
public ByteArrayInputOutputStream()
ByteArrayInputOutputStream
public ByteArrayInputOutputStream(int size)
getInputStream
public ByteArrayInputStream getInputStream()
- Get a byte array input stream based on the current byte buffer for the
output stream. Behaviour of the input stream may get screwy if you write to
the output stream, and particularly if you call
ByteArrayOutputStream.reset()
after
calling this method.
- Returns:
- A byte array input stream.