Class CachedByteArrayOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ByteArrayOutputStream
-
- org.apache.camel.converter.stream.CachedByteArrayOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public final class CachedByteArrayOutputStream extends ByteArrayOutputStream
AByteArrayOutputStream
that is capable of returning aInputStreamCache
view of the buffer. This implementation avoids any buffer copying when caching in memoryInputStream
as the buffer can be shared.
-
-
Field Summary
-
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
-
-
Constructor Summary
Constructors Constructor Description CachedByteArrayOutputStream(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamCache
newInputStreamCache()
Creates a newInputStreamCache
view of the byte array-
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, toString, write, write, writeBytes, writeTo
-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
-
-
-
Method Detail
-
newInputStreamCache
public InputStreamCache newInputStreamCache()
Creates a newInputStreamCache
view of the byte array
-
-