Class BAAInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.axiom.attachments.utils.BAAInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class BAAInputStream extends InputStream
BAAInputStream is like a ByteArrayInputStream. A ByteArrayInputStream stores the backing data in a byte[]. BAAInputStream stores the backing data in a Array of byte[]. Using several non-contiguous chunks reduces memory copy and resizing.
-
-
Constructor Summary
Constructors Constructor Description BAAInputStream(ArrayList data, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int off, int len)voidreset()voidwriteTo(OutputStream os)Write all of the buffers to the output stream-
Methods inherited from class java.io.InputStream
close, nullInputStream, readAllBytes, readNBytes, readNBytes, skip, transferTo
-
-
-
-
Constructor Detail
-
BAAInputStream
public BAAInputStream(ArrayList data, int size)
-
-
Method Detail
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
writeTo
public void writeTo(OutputStream os) throws IOException
Write all of the buffers to the output stream- Parameters:
os-- Throws:
IOException
-
-