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
AByteArrayOutputStreamthat is capable of returning aInputStreamCacheview of the buffer. This implementation avoids any buffer copying when caching in memoryInputStreamas 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 InputStreamCachenewInputStreamCache()Creates a newInputStreamCacheview 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 newInputStreamCacheview of the byte array
-
-