Index: luni/src/main/java/java/io/PushbackInputStream.java =================================================================== --- luni/src/main/java/java/io/PushbackInputStream.java (revision 428373) +++ luni/src/main/java/java/io/PushbackInputStream.java (working copy) @@ -127,6 +127,11 @@ */ public int read() throws IOException { if (buf != null) { + + if(in == null){ + buf = null; + throw new IOException("Stream closed"); + } // Is there a pushback byte available? if (pos < buf.length) return (buf[pos++] & 0xFF);