-
Bug
-
Resolution: Unresolved
-
P3
-
None
-
11, 25
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
write() to an InflatOutputStream after finish() will cause NPE.
---------- BEGIN SOURCE ----------
InflaterOutputStream ios = new InflaterOutputStream(OutputStream.nullOutputStream());
ios.finish();
try {
ios.write(1);
} catch (Exception e) {
System.out.println("InflaterOutputStream NPE after finish(): " + e.getClass().getName());
}
---------- END SOURCE ----------
Expected Behavior:
Per Java's OutputStream convention, after finish() (or close()), further calls to write() should throw an IOException indicating the stream is closed, not an NPE.
Actual Behavior:
Instead, InflaterOutputStream.write() will throw a NullPointerException.
write() to an InflatOutputStream after finish() will cause NPE.
---------- BEGIN SOURCE ----------
InflaterOutputStream ios = new InflaterOutputStream(OutputStream.nullOutputStream());
ios.finish();
try {
ios.write(1);
} catch (Exception e) {
System.out.println("InflaterOutputStream NPE after finish(): " + e.getClass().getName());
}
---------- END SOURCE ----------
Expected Behavior:
Per Java's OutputStream convention, after finish() (or close()), further calls to write() should throw an IOException indicating the stream is closed, not an NPE.
Actual Behavior:
Instead, InflaterOutputStream.write() will throw a NullPointerException.