Package org.apache.myfaces.util.lang
Class FastByteArrayOutputStream
- java.lang.Object
- 
- java.io.OutputStream
- 
- org.apache.myfaces.util.lang.FastByteArrayOutputStream
 
 
- 
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
 
 public class FastByteArrayOutputStream extends OutputStream ByteArrayOutputStream implementation that doesn't synchronize methods and doesn't copy the data on toByteArray().
- 
- 
Constructor SummaryConstructors Constructor Description FastByteArrayOutputStream()FastByteArrayOutputStream(int size)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getByteArray()Returns the byte array containing the written data.InputStreamgetInputStream()Returns a ByteArrayInputStream for reading back the written dataintgetSize()voidreset()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)- 
Methods inherited from class java.io.OutputStreamclose, flush, nullOutputStream
 
- 
 
- 
- 
- 
Method Detail- 
getSizepublic int getSize() 
 - 
getByteArraypublic byte[] getByteArray() Returns the byte array containing the written data. Note that this array will almost always be larger than the amount of data actually written.
 - 
writepublic final void write(byte[] b) - Overrides:
- writein class- OutputStream
 
 - 
writepublic final void write(byte[] b, int off, int len)- Overrides:
- writein class- OutputStream
 
 - 
writepublic final void write(int b) - Specified by:
- writein class- OutputStream
 
 - 
resetpublic void reset() 
 - 
getInputStreampublic InputStream getInputStream() Returns a ByteArrayInputStream for reading back the written data
 
- 
 
-