org.apache.camel.converter.stream
Class CachedByteArrayOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
org.apache.camel.converter.stream.CachedByteArrayOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public final class CachedByteArrayOutputStream
- extends ByteArrayOutputStream
A ByteArrayOutputStream
that is capable of returning a
InputStreamCache
view of the buffer.
This implementation avoids any buffer copying when caching in memory InputStream
as the buffer can be shared.
CachedByteArrayOutputStream
public CachedByteArrayOutputStream(int size)
newInputStreamCache
public InputStreamCache newInputStreamCache()
- Creates a new
InputStreamCache
view of the byte array
Apache Camel