From 978bdcc40306116c10757646750d3a9c9bb0e019 Mon Sep 17 00:00:00 2001 From: Tilman Hausherr Date: Tue, 14 Jan 2025 14:05:23 +0100 Subject: [PATCH] TIKA-4326: replace deprecated --- .../main/java/org/apache/tika/utils/RereadableInputStream.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tika-core/src/main/java/org/apache/tika/utils/RereadableInputStream.java b/tika-core/src/main/java/org/apache/tika/utils/RereadableInputStream.java index db38977b3a..e2fdba1ab9 100644 --- a/tika-core/src/main/java/org/apache/tika/utils/RereadableInputStream.java +++ b/tika-core/src/main/java/org/apache/tika/utils/RereadableInputStream.java @@ -257,7 +257,8 @@ public void rewind() throws IOException { // If we have a buffer, then we'll read from it if (byteBuffer != null) { readingFromBuffer = true; - inputStream = new UnsynchronizedByteArrayInputStream(byteBuffer, 0, bufferHighWaterMark); + inputStream = UnsynchronizedByteArrayInputStream.builder(). + setByteArray(byteBuffer).setOffset(0).setLength(bufferHighWaterMark).get(); } else { // No buffer, which means we've switched to a file inputStream = new BufferedInputStream(new FileInputStream(storeFile));