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
ByteArrayOutputStream implementation that doesn't synchronize methods
 and doesn't copy the data on toByteArray().
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryMethods inherited from class java.io.OutputStreamclose, flush, nullOutputStream
- 
Field Details- 
bufprotected byte[] buf
- 
sizeprotected int size
 
- 
- 
Constructor Details- 
FastByteArrayOutputStreampublic FastByteArrayOutputStream()
- 
FastByteArrayOutputStreampublic FastByteArrayOutputStream(int size) 
 
- 
- 
Method Details- 
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()
- 
getInputStreamReturns a ByteArrayInputStream for reading back the written data
 
-