From 766f6181e7913a104a453999df7105d7f8700066 Mon Sep 17 00:00:00 2001 From: Peter Winckles Date: Wed, 8 Sep 2021 10:40:46 -0500 Subject: [PATCH] upgrade ocfl-java to fix buffering bug (#43) * upgrade ocfl-java to fix buffering bug * buffer files read from staging --- pom.xml | 2 +- .../java/org/fcrepo/storage/ocfl/DefaultOcflObjectSession.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e7548f6..407c8b8 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 3.1.1 3.0.1 3.2.0 - 1.1.0 + 1.2.3 diff --git a/src/main/java/org/fcrepo/storage/ocfl/DefaultOcflObjectSession.java b/src/main/java/org/fcrepo/storage/ocfl/DefaultOcflObjectSession.java index af3489b..29ac869 100644 --- a/src/main/java/org/fcrepo/storage/ocfl/DefaultOcflObjectSession.java +++ b/src/main/java/org/fcrepo/storage/ocfl/DefaultOcflObjectSession.java @@ -40,6 +40,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.io.UncheckedIOException; @@ -574,7 +575,7 @@ private Optional readFromStaging(final PathPair path) { if (Files.exists(stagingPath)) { try { - return Optional.of(Files.newInputStream(stagingPath)); + return Optional.of(new BufferedInputStream(Files.newInputStream(stagingPath))); } catch (final IOException e) { throw new UncheckedIOException(e); }