You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by le...@apache.org on 2022/05/01 17:45:38 UTC

svn commit: r1900461 - /pdfbox/trunk/io/src/main/java/org/apache/pdfbox/io/RandomAccessReadBufferedFile.java

Author: lehmi
Date: Sun May  1 17:45:38 2022
New Revision: 1900461

URL: http://svn.apache.org/viewvc?rev=1900461&view=rev
Log: (empty)

Modified:
    pdfbox/trunk/io/src/main/java/org/apache/pdfbox/io/RandomAccessReadBufferedFile.java

Modified: pdfbox/trunk/io/src/main/java/org/apache/pdfbox/io/RandomAccessReadBufferedFile.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/io/src/main/java/org/apache/pdfbox/io/RandomAccessReadBufferedFile.java?rev=1900461&r1=1900460&r2=1900461&view=diff
==============================================================================
--- pdfbox/trunk/io/src/main/java/org/apache/pdfbox/io/RandomAccessReadBufferedFile.java (original)
+++ pdfbox/trunk/io/src/main/java/org/apache/pdfbox/io/RandomAccessReadBufferedFile.java Sun May  1 17:45:38 2022
@@ -65,6 +65,7 @@ public class RandomAccessReadBufferedFil
     private int offsetWithinPage = 0;
 
     private final FileChannel fileChannel;
+    private final File file;
     private final long fileLength;
     private long fileOffset = 0;
     private boolean isClosed;
@@ -88,6 +89,7 @@ public class RandomAccessReadBufferedFil
      */
     public RandomAccessReadBufferedFile( File file ) throws IOException 
     {
+        this.file = file;
         fileChannel = FileChannel.open(file.toPath(), StandardOpenOption.READ);
         fileLength = file.length();
         seek(0);
@@ -270,7 +272,7 @@ public class RandomAccessReadBufferedFil
             }
             readBytes += curBytesRead;
         }
-        return new RandomAccessReadView(new RandomAccessReadBuffer(byteBuffer), 0, streamLength,
-                true);
+        return new RandomAccessReadView(new RandomAccessReadBufferedFile(file), startPosition,
+                streamLength, true);
     }
 }