public class BAAOutputStream extends java.io.OutputStream implements ReadFromSupport
| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
BUFFER_SIZE |
(package private) byte[] |
currBuffer |
(package private) java.util.ArrayList |
data |
(package private) int |
index |
(package private) byte[] |
writeByte |
| Constructor and Description |
|---|
BAAOutputStream() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addBuffer() |
java.util.ArrayList |
buffers() |
int |
length() |
long |
readFrom(java.io.InputStream is,
long maxRead)
Read data from the given input stream and write it to this output stream.
|
long |
receive(java.io.InputStream is,
long maxRead) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
java.util.ArrayList data
static final int BUFFER_SIZE
int index
byte[] currBuffer
byte[] writeByte
private void addBuffer()
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic java.util.ArrayList buffers()
public int length()
public long receive(java.io.InputStream is,
long maxRead)
throws java.io.IOException
is - InputStream containing datamaxRead - the maximum number of bytes to receivejava.io.IOExceptionpublic long readFrom(java.io.InputStream is,
long maxRead)
throws StreamCopyException
ReadFromSupportlength argument is different from -1
and the number of bytes transferred is equal to length.
readFrom in interface ReadFromSupportis - An input stream to read data from. This method will not close the stream.maxRead - the number of bytes to transfer, or -1 if the method should
transfer data until the end of the input stream is reachedStreamCopyException