Class InputStreamCache

java.lang.Object
java.io.InputStream
java.io.ByteArrayInputStream
org.apache.camel.converter.stream.InputStreamCache
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.camel.StreamCache

public final class InputStreamCache extends ByteArrayInputStream implements org.apache.camel.StreamCache
A StreamCache for caching using an in-memory byte array.

Important: All the classes from the Camel release that implements StreamCache is NOT intended for end users to create as instances, but they are part of Camels stream-caching functionality.

  • Constructor Details

    • InputStreamCache

      public InputStreamCache(byte[] data)
    • InputStreamCache

      public InputStreamCache(byte[] data, int count)
  • Method Details

    • writeTo

      public void writeTo(OutputStream os) throws IOException
      Specified by:
      writeTo in interface org.apache.camel.StreamCache
      Throws:
      IOException
    • copy

      public org.apache.camel.StreamCache copy(org.apache.camel.Exchange exchange)
      Specified by:
      copy in interface org.apache.camel.StreamCache
    • inMemory

      public boolean inMemory()
      Specified by:
      inMemory in interface org.apache.camel.StreamCache
    • length

      public long length()
      Specified by:
      length in interface org.apache.camel.StreamCache
    • position

      public long position()
      Specified by:
      position in interface org.apache.camel.StreamCache