From 3f1f6e2d2b6285663cc8e7f7ebdf1ce759cdd589 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 16 Mar 2013 18:16:06 +0100 Subject: [PATCH] Throw EOF exception on EOF. --- .../java/net/pterodactylus/sonitus/data/filter/ExternalFilter.java | 3 +++ 1 file changed, 3 insertions(+) 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); } -- 2.7.4