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
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.

  • Constructor Details

    • CachedByteArrayOutputStream

      public CachedByteArrayOutputStream(int size)
  • Method Details