From f2d7de4661745eff0fd9d9e6cc46963f8d0a6934 Mon Sep 17 00:00:00 2001 From: RuedigerMoeller Date: Mon, 19 Jun 2017 10:09:03 +0200 Subject: [PATCH] merge pull requests --- .../org/nustaq/serialization/util/FSTInputStream.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/nustaq/serialization/util/FSTInputStream.java b/src/main/java/org/nustaq/serialization/util/FSTInputStream.java index c73c9b5a..89ab0311 100644 --- a/src/main/java/org/nustaq/serialization/util/FSTInputStream.java +++ b/src/main/java/org/nustaq/serialization/util/FSTInputStream.java @@ -29,6 +29,8 @@ */ public final class FSTInputStream extends InputStream { + public static final boolean REPORT_READ_FAILS = false; + private static final FSTLogger LOGGER = FSTLogger.getLogger(FSTInputStream.class); public int chunk_size = 8000; @@ -85,8 +87,12 @@ public void readNextChunk(InputStream in) { fullyRead = true; } } catch (IOException e) { - LOGGER.log(FSTLogger.Level.ERROR, "Failed to read next chunk from InputStream", e); - throw new RuntimeException("Failed to read next chunk from InputStream", e); + if ( REPORT_READ_FAILS ) { // flag bound to avoid breaking things .. + LOGGER.log(FSTLogger.Level.ERROR, "Failed to read next chunk from InputStream", e); + throw new RuntimeException("Failed to read next chunk from InputStream", e); + } else { + fullyRead = true; + } } }