From 87d7de3090ed55b93eeb1f0230ac1e6ad98ee066 Mon Sep 17 00:00:00 2001 From: Scott Crosby Date: Mon, 10 Jan 2011 22:22:00 -0600 Subject: [PATCH] Get rid of the input.available call. --- src.java/crosby/binary/file/BlockInputStream.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src.java/crosby/binary/file/BlockInputStream.java b/src.java/crosby/binary/file/BlockInputStream.java index 7274a1e..1266e5e 100644 --- a/src.java/crosby/binary/file/BlockInputStream.java +++ b/src.java/crosby/binary/file/BlockInputStream.java @@ -17,6 +17,7 @@ package crosby.binary.file; +import java.io.EOFException; import java.io.IOException; import java.io.InputStream; @@ -28,10 +29,13 @@ public class BlockInputStream { } public void process() throws IOException { - while (input.available() > 0) { - FileBlock.process(input, adaptor); + try { + while (true) { + FileBlock.process(input, adaptor); } + } catch (EOFException e) { adaptor.complete(); + } } public void close() throws IOException {