public class ByteArrayIOStream extends ByteArrayOutputStream
Modifier and Type | Class and Description |
---|---|
static class |
ByteArrayIOStream.ByteArrayIOInputStream
bytearrayinputstream that allows duplication without copying
|
buf, count
Constructor and Description |
---|
ByteArrayIOStream()
creates an empty input output stream class
|
ByteArrayIOStream(byte[] b)
creates a sized input output stream class
|
ByteArrayIOStream(File f)
create a ByteArrayIOStream from a file
|
ByteArrayIOStream(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(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
|
String |
toString() |
reset, size, toByteArray, toString, toString, write, write, writeTo
flush, write
public ByteArrayIOStream()
public ByteArrayIOStream(int i)
i
- the size of the streampublic ByteArrayIOStream(InputStream is)
is
- the inputstream to bufferpublic ByteArrayIOStream(File f) throws IOException
f
- the fileIOException
public ByteArrayIOStream(byte[] b)
b
- the buffer to use (is NOT copied)public static ByteArrayIOStream.ByteArrayIOInputStream getBufferedInputStream(InputStream is)
is
- public ByteArrayIOStream.ByteArrayIOInputStream getInputStream()
public byte[] getBuf()
public String toString()
toString
in class ByteArrayOutputStream
ByteArrayOutputStream.toString()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class ByteArrayOutputStream
ByteArrayOutputStream.close()
Copyright © 2018. All rights reserved.