From 50085d74abeb8fd53901419f91a0874222e9e6df Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 13 Mar 2017 18:16:29 -0400 Subject: tidy --- README.md | 1 + dslog/Read.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..17db575 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +https://www.chiefdelphi.com/forums/showthread.php?t=104689 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; } } -- cgit v1.2.3