public class ByteArrayIOFileStream extends ByteArrayIOStream
| Modifier and Type | Class and Description |
|---|---|
static class |
ByteArrayIOFileStream.ByteArrayIOFileInputStream
bytearrayinputstream that allows duplication without copying
|
ByteArrayIOStream.ByteArrayIOInputStream| Constructor and Description |
|---|
ByteArrayIOFileStream(java.io.File f,
long maxLength,
boolean readOnly)
create a ByteArrayIOStream from a file
|
ByteArrayIOFileStream(java.io.InputStream is,
long maxLength)
creates an input output stream class from any stream
if is already 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(java.io.InputStream is,
long maxLen)
get a completely buffered and resizable input stream
|
java.io.File |
getFile() |
ByteArrayIOStream.ByteArrayIOInputStream |
getInputStream()
gets an input stream based on the current byte contents - note this operates on the internal data
|
int |
size() |
java.lang.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, getBufferedInputStreampublic ByteArrayIOFileStream(long maxLength)
maxLength - the maximum length in memorypublic ByteArrayIOFileStream(java.io.InputStream is,
long maxLength)
is - the inputstream to buffermaxLength - the maximum length in memorypublic ByteArrayIOFileStream(java.io.File f,
long maxLength,
boolean readOnly)
f - the filemaxLength - the maximum length in memoryreadOnly - java.io.IOExceptionpublic static ByteArrayIOStream.ByteArrayIOInputStream getBufferedInputStream(java.io.InputStream is, long maxLen)
is - public ByteArrayIOStream.ByteArrayIOInputStream getInputStream()
getInputStream in class ByteArrayIOStreampublic java.lang.String toString()
toString in class ByteArrayIOStreamByteArrayOutputStream.toString()public void write(int b)
write in class java.io.ByteArrayOutputStreamb - 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 java.io.ByteArrayOutputStreamb - the data.off - the start offset in the data.len - the number of bytes to write.public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class ByteArrayIOStreamByteArrayOutputStream.close()protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic int size()
size in class java.io.ByteArrayOutputStreampublic java.io.File getFile()