diff options
Diffstat (limited to 'dslog/Read.java')
-rw-r--r-- | dslog/Read.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dslog/Read.java b/dslog/Read.java index 04537d5..ba5bcde 100644 --- a/dslog/Read.java +++ b/dslog/Read.java @@ -5,14 +5,16 @@ import java.io.InputStream; import java.io.IOException; import java.io.EOFException; import java.time.Instant; +import java.util.NoSuchElementException; class Read { public static void full(InputStream in, byte b[]) throws IOException { int n = 0; while (n < b.length) { int count = in.read(b, n, b.length - n); - if (count < 0) + if (count < 0) { throw new EOFException(); + } n += count; } } |