org.apache.axiom.attachments.utils
Class BAAInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.axiom.attachments.utils.BAAInputStream
All Implemented Interfaces:
Closeable

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
BAAInputStream(ArrayList data, int size)
           
 
Method Summary
 int available()
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 void writeTo(OutputStream os)
          Write all of the buffers to the output stream
 
Methods inherited from class java.io.InputStream
close, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BAAInputStream

public BAAInputStream(ArrayList data,
                      int size)
Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

mark

public void mark(int readlimit)
Overrides:
mark in class InputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

reset

public void reset()
           throws IOException
Overrides:
reset in class InputStream
Throws:
IOException

writeTo

public void writeTo(OutputStream os)
             throws IOException
Write all of the buffers to the output stream

Parameters:
os -
Throws:
IOException


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.