From 9ad1c0e8a8180683efbcc208858a35ad26e86288 Mon Sep 17 00:00:00 2001 From: Katharina Schmid Date: Tue, 18 Jun 2024 13:24:28 +0200 Subject: [PATCH] Fix read offsets and length --- .../java/com/github/dbmdz/solrocr/reader/BaseSourceReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/github/dbmdz/solrocr/reader/BaseSourceReader.java b/src/main/java/com/github/dbmdz/solrocr/reader/BaseSourceReader.java index 58d0de83..e56a6b50 100644 --- a/src/main/java/com/github/dbmdz/solrocr/reader/BaseSourceReader.java +++ b/src/main/java/com/github/dbmdz/solrocr/reader/BaseSourceReader.java @@ -218,7 +218,7 @@ public Section getAsciiSection(int offset) throws IOException { int readLen = Math.min(sectionSize, this.length() - startOffset); int numRead = 0; while(numRead < readLen) { - numRead += this.readBytes(copyBuf, 0, startOffset, readLen); + numRead += this.readBytes(copyBuf, numRead, startOffset + numRead, readLen - numRead); } // Construct a String without going through a decoder to save on CPU. // Given that the method has been deprecated since Java 1.1 and was never removed, I don't think