com.imagero.uio.io
Class ByteArrayOutputStream2

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.ByteArrayOutputStream
          extended bycom.imagero.uio.io.ByteArrayOutputStream2

public class ByteArrayOutputStream2
extends java.io.ByteArrayOutputStream

ByteArrayOutputStream which writes to external buffer.


Field Summary
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
ByteArrayOutputStream2(byte[] buffer)
           
 
Method Summary
 void write(byte[] b, int off, int len)
          Writes bytes from the specified byte array to buffer
 void write(int b)
          write given byte to buffer.
 
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, writeTo
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteArrayOutputStream2

public ByteArrayOutputStream2(byte[] buffer)
Method Detail

write

public void write(int b)
write given byte to buffer.

Parameters:
b - byte to write
Throws:
java.lang.ArrayIndexOutOfBoundsException - if new byte count would exceed length of buffer after this operation

write

public void write(byte[] b,
                  int off,
                  int len)
Writes bytes from the specified byte array to buffer

Parameters:
b - byte array
off - start offset
len - number of bytes to write
Throws:
java.lang.ArrayIndexOutOfBoundsException - if new byte count would exceed length of buffer after this operation (however the max possible byte count is written first)