org.apache.axiom.attachments.utils
Class BAAOutputStream
java.lang.Object
java.io.OutputStream
org.apache.axiom.attachments.utils.BAAOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class BAAOutputStream
- extends OutputStream
BAAOutputStream is like a ByteArrayOutputStream.
A ByteArrayOutputStream stores the backing data in a byte[].
BAAOutputStream stores the backing data in a Array of
byte[]. Using several non-contiguous chunks reduces
memory copy and resizing.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BAAOutputStream
public BAAOutputStream()
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Overrides:
write
in class OutputStream
- Throws:
IOException
write
public void write(byte[] b)
throws IOException
- Overrides:
write
in class OutputStream
- Throws:
IOException
write
public void write(int b)
throws IOException
- Specified by:
write
in class OutputStream
- Throws:
IOException
buffers
public ArrayList buffers()
length
public int length()
receive
public long receive(InputStream is,
long maxRead)
throws IOException
- Parameters:
is
- InputStream containing datamaxRead
- the maximum number of bytes to receive
- Returns:
- bytesReceived
- Throws:
IOException
Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.