Class RandomAccessStreamCacheImpl

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, RandomAccessStreamCache

    public class RandomAccessStreamCacheImpl
    extends java.lang.Object
    implements RandomAccessStreamCache
    A default implementation of the interface RandomAccessStreamCache using a memory backed RandomAccessReadWriteBuffer.
    • Constructor Detail

      • RandomAccessStreamCacheImpl

        public RandomAccessStreamCacheImpl()
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • createBuffer

        public RandomAccess createBuffer()
                                  throws java.io.IOException
        Creates an instance of a buffer implementing the interface org.apache.pdfbox.io.RandomAccess. The caller should close the buffer after usage otherwise the buffer shall be closed once the underlying RandomAccessStreamCache is closed.
        Specified by:
        createBuffer in interface RandomAccessStreamCache
        Returns:
        the instance of the buffer
        Throws:
        java.io.IOException - if something went wrong