From: David ‘Bombe’ Roden Date: Sat, 16 Mar 2013 17:16:06 +0000 (+0100) Subject: Throw EOF exception on EOF. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=3f1f6e2d2b6285663cc8e7f7ebdf1ce759cdd589;p=sonitus.git Throw EOF exception on EOF. --- diff --git a/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalFilter.java b/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalFilter.java index c2f6715..5557fbb 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalFilter.java +++ b/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalFilter.java @@ -67,6 +67,9 @@ public abstract class ExternalFilter implements Filter { public byte[] get(int bufferSize) throws EOFException, IOException { byte[] buffer = new byte[bufferSize]; int read = pipedInputStream.read(buffer); + if (read == -1) { + throw new EOFException(); + } return Arrays.copyOf(buffer, read); }