public class ByteArrayIOFileStream extends ByteArrayIOStream
| Modifier and Type | Class and Description |
|---|---|
static class |
ByteArrayIOFileStream.ByteArrayIOFileInputStream
bytearrayinputstream that allows duplication without copying
|
ByteArrayIOStream.ByteArrayIOInputStreambuf, 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, getBufferedInputStreamreset, toByteArray, toString, toString, writeToflush, writepublic 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 - IOExceptionpublic static ByteArrayIOStream.ByteArrayIOInputStream getBufferedInputStream(InputStream is, long maxLen)
is - public ByteArrayIOStream.ByteArrayIOInputStream getInputStream()
getInputStream in class ByteArrayIOStreampublic String toString()
toString in class ByteArrayIOStreamByteArrayOutputStream.toString()public void write(int b)
write in class 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 ByteArrayOutputStreamb - the data.off - the start offset in the data.len - the number of bytes to write.public void close()
close in interface Closeableclose in interface AutoCloseableclose in class ByteArrayIOStreamByteArrayOutputStream.close()protected void finalize()
throws Throwable
public int size()
size in class ByteArrayOutputStreamCopyright © 2015. All rights reserved.