Fix read(byte[]) method.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 3 Jun 2013 20:24:49 +0000 (22:24 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 4 Jun 2013 04:21:45 +0000 (06:21 +0200)
src/main/java/net/pterodactylus/sonitus/io/RememberingInputStream.java

index 5fae4b2..8c2e3e6 100644 (file)
@@ -81,11 +81,7 @@ public class RememberingInputStream extends FilterInputStream {
 
        @Override
        public int read(byte[] bytes) throws IOException {
-               int read = super.read(bytes);
-               if (read != -1) {
-                       rememberBuffer.write(bytes, 0, read);
-               }
-               return read;
+               return read(bytes, 0, bytes.length);
        }
 
        @Override