public class ByteArrayIOStream
extends java.io.ByteArrayOutputStream
| Modifier and Type | Class and Description |
|---|---|
static class |
ByteArrayIOStream.ByteArrayIOInputStream
bytearrayinputstream that allows duplication without copying
|
| Constructor and Description |
|---|
ByteArrayIOStream()
creates an empty input output stream class
|
ByteArrayIOStream(byte[] b)
creates a sized input output stream class
|
ByteArrayIOStream(java.io.File f)
create a ByteArrayIOStream from a file
|
ByteArrayIOStream(java.io.InputStream is)
creates an input output stream class from any stream if is alraedy is a buffered inputstream, no copy is made
|
ByteArrayIOStream(int i)
creates a sized input output stream class
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
byte[] |
getBuf()
get the internal buffer - be careful, this is THE buffer
|
static ByteArrayIOStream.ByteArrayIOInputStream |
getBufferedInputStream(java.io.InputStream is)
get a completely buffered and resizable input stream
|
ByteArrayIOStream.ByteArrayIOInputStream |
getInputStream()
gets an input stream based on the current byte contents - note this operates on the internal data
|
java.lang.String |
toString() |
public ByteArrayIOStream()
public ByteArrayIOStream(int i)
i - the size of the streampublic ByteArrayIOStream(java.io.InputStream is)
is - the inputstream to bufferpublic ByteArrayIOStream(java.io.File f)
throws java.io.IOException
f - the filejava.io.IOExceptionpublic ByteArrayIOStream(byte[] b)
b - the buffer to use (is NOT copied)public static ByteArrayIOStream.ByteArrayIOInputStream getBufferedInputStream(java.io.InputStream is)
is - public ByteArrayIOStream.ByteArrayIOInputStream getInputStream()
public byte[] getBuf()
public java.lang.String toString()
toString in class java.io.ByteArrayOutputStreamByteArrayOutputStream.toString()public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.ByteArrayOutputStreamByteArrayOutputStream.close()