public class ByteArrayIOFileStream extends ByteArrayIOStream
Modifier and Type | Class and Description |
---|---|
static class |
ByteArrayIOFileStream.ByteArrayIOFileInputStream
bytearrayinputstream that allows duplication without copying
|
ByteArrayIOStream.ByteArrayIOInputStream
buf, count
Constructor and Description |
---|
ByteArrayIOFileStream(File f,
long maxLength,
boolean readOnly)
create a ByteArrayIOStream from a file
|
ByteArrayIOFileStream(InputStream is,
long maxLength)
creates an input output stream class from any stream
if is alraedy is a buffered inputstream, no copy is made
|
ByteArrayIOFileStream(long maxLength)
creates an empty input output stream class
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
static ByteArrayIOStream.ByteArrayIOInputStream |
getBufferedInputStream(InputStream is,
long maxLen)
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
|
int |
size() |
String |
toString() |
void |
write(byte[] b,
int off,
int len)
Writes
len bytes from the specified byte array
starting at offset off to this byte array output stream. |
void |
write(int b)
Writes the specified byte to this byte array output stream.
|
getBuf, getBufferedInputStream
reset, toByteArray, toString, toString, writeTo
flush, write
public ByteArrayIOFileStream(long maxLength)
maxLength
- the maximum length in memorypublic ByteArrayIOFileStream(InputStream is, long maxLength)
is
- the inputstream to buffermaxLength
- the maximum length in memorypublic ByteArrayIOFileStream(File f, long maxLength, boolean readOnly)
f
- the filemaxLength
- the maximum length in memoryreadOnly
- IOException
public static ByteArrayIOStream.ByteArrayIOInputStream getBufferedInputStream(InputStream is, long maxLen)
is
- public ByteArrayIOStream.ByteArrayIOInputStream getInputStream()
getInputStream
in class ByteArrayIOStream
public String toString()
toString
in class ByteArrayIOStream
ByteArrayOutputStream.toString()
public void write(int b)
write
in class ByteArrayOutputStream
b
- the byte to be written.public void write(byte[] b, int off, int len)
len
bytes from the specified byte array
starting at offset off
to this byte array output stream.write
in class ByteArrayOutputStream
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class ByteArrayIOStream
ByteArrayOutputStream.close()
protected void finalize() throws Throwable
public int size()
size
in class ByteArrayOutputStream
Copyright © 2018. All rights reserved.