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/22 13:26:21 UTC

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

Author: lehmi
Date: Sun May 22 13:26:21 2022
New Revision: 1901123

URL: http://svn.apache.org/viewvc?rev=1901123&view=rev
Log:
PDFBOX-4893: remove no longer needed ByteBuffer

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=1901123&r1=1901122&r2=1901123&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 22 13:26:21 2022
@@ -258,20 +258,6 @@ public class RandomAccessReadBufferedFil
     public RandomAccessReadView createView(long startPosition, long streamLength) throws IOException
     {
         checkClosed();
-        // support long values?
-        ByteBuffer byteBuffer = ByteBuffer.allocate((int) streamLength);
-        fileChannel.position(startPosition);
-        int readBytes = 0;
-        while (readBytes < streamLength)
-        {
-            int curBytesRead = fileChannel.read(byteBuffer);
-            if (curBytesRead < 0)
-            {
-                // EOF
-                break;
-            }
-            readBytes += curBytesRead;
-        }
         return new RandomAccessReadView(new RandomAccessReadBufferedFile(file), startPosition,
                 streamLength, true);
     }