Package org.apache.cxf.helpers
Class LoadingByteArrayOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
org.apache.cxf.helpers.LoadingByteArrayOutputStream
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
Subclass of ByteArrayOutputStream that allows creation of a
 ByteArrayInputStream directly without creating a copy of the byte[].
 Also, on "toByteArray()" it truncates it's buffer to the current size
 and returns the new buffer directly.  Multiple calls to toByteArray()
 will return the exact same byte[] unless a write is called in between.
 Note: once the InputStream is created, the output stream should
 no longer be used.  In particular, make sure not to call reset()
 and then write as that may overwrite the data that the InputStream
 is using.
- 
Field SummaryFields inherited from class java.io.ByteArrayOutputStreambuf, count
- 
Constructor SummaryConstructors
- 
Method SummaryMethods inherited from class java.io.ByteArrayOutputStreamclose, reset, size, toString, toString, toString, toString, write, write, writeBytes, writeToMethods inherited from class java.io.OutputStreamflush, nullOutputStream, write
- 
Constructor Details- 
LoadingByteArrayOutputStreampublic LoadingByteArrayOutputStream()
- 
LoadingByteArrayOutputStreampublic LoadingByteArrayOutputStream(int i) 
 
- 
- 
Method Details- 
createInputStream
- 
setSizepublic void setSize(int i) 
- 
toByteArraypublic byte[] toByteArray()- Overrides:
- toByteArrayin class- ByteArrayOutputStream
 
- 
getRawBytespublic byte[] getRawBytes()
 
-