in.close();
}
public void testChunkedInputStreamClose() throws IOException {
String s = "5\r\n01234\r\n5\r\n56789\r\n0\r\n";
ChunkedInputStream in = new ChunkedInputStream(
new SessionInputBufferMockup(
EncodingUtils.getBytes(s, CONTENT_CHARSET)));
in.close();
in.close();
try {
in.read();
fail("IOException should have been thrown");
} catch (IOException ex) {
// expected
}
byte[] tmp = new byte[10];
try {
in.read(tmp);
fail("IOException should have been thrown");
} catch (IOException ex) {
// expected
}
try {
in.read(tmp, 0, tmp.length);
fail("IOException should have been thrown");
} catch (IOException ex) {
// expected
}
}