Skip to content

Commit

Permalink
merge pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
RuedigerMoeller committed Jun 19, 2017
1 parent b7b3410 commit f2d7de4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/org/nustaq/serialization/util/FSTInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit f2d7de4

Please sign in to comment.