jlibs.core.io
Class ByteArrayOutputStream2

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.ByteArrayOutputStream
          extended by jlibs.core.io.ByteArrayOutputStream2
All Implemented Interfaces:
Closeable, Flushable

public class ByteArrayOutputStream2
extends ByteArrayOutputStream

This is an extension of ByteArrayOutputStream.

You can get access to the internal byte buffer using toByteSequence()

Author:
Santhosh Kumar T

Field Summary
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
ByteArrayOutputStream2()
           
ByteArrayOutputStream2(InputStream is, int readBuffSize, boolean close)
           
ByteArrayOutputStream2(int size)
           
 
Method Summary
 int readFrom(InputStream is, int readBuffSize, boolean close)
           
 ByteSequence toByteSequence()
          Returns the input data as ByteSequence.
Note that the internal buffer is not copied.
 
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, write, write, 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()

ByteArrayOutputStream2

public ByteArrayOutputStream2(int size)

ByteArrayOutputStream2

public ByteArrayOutputStream2(InputStream is,
                              int readBuffSize,
                              boolean close)
                       throws IOException
Throws:
IOException
Method Detail

toByteSequence

public ByteSequence toByteSequence()
Returns the input data as ByteSequence.
Note that the internal buffer is not copied.


readFrom

public int readFrom(InputStream is,
                    int readBuffSize,
                    boolean close)
             throws IOException
Throws:
IOException


Copyright © 2018. All rights reserved.