com.bea.wli.management.internal
Class ByteArrayOutputStreamLimited

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.ByteArrayOutputStream
          extended by com.bea.wli.management.internal.ByteArrayOutputStreamLimited
All Implemented Interfaces:
Closeable, Flushable

public class ByteArrayOutputStreamLimited
extends ByteArrayOutputStream

Internal use only. Allows output to a byte array up to a certain maximum size (in bytes). If the size of the output exceeds throws an IndexOutOfBoundsException


Constructor Summary
ByteArrayOutputStreamLimited(int hardLimit)
           
 
Method Summary
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, writeTo
 
Methods inherited from class java.io.OutputStream
flush
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteArrayOutputStreamLimited

public ByteArrayOutputStreamLimited(int hardLimit)
Parameters:
hardLimit - maximum number of bytes allowed to be output
Method Detail

write

public void write(int b)
Overrides:
write in class ByteArrayOutputStream
Throws:
IndexOutOfBoundsException - if the size of the output will exceed the hard limit upon writing the new data

write

public void write(byte[] b,
                  int off,
                  int len)
Overrides:
write in class ByteArrayOutputStream
Throws:
IndexOutOfBoundsException - if the size of the output will exceed the hard limit upon writing the new data

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IndexOutOfBoundsException - if the size of the output will exceed the hard limit upon writing the new data
IOException