*
* @throws IOException
*/
public void testFailureGetInputAfterCloseInput() throws IOException {
StreamBuffer streamBuffer = new DefaultStreamBuffer();
OutputStream output = streamBuffer.getOutput();
output.write(new byte[]{1, 2, 3});
output.close();
InputStream input = streamBuffer.getInput();
byte[] buffer = new byte[3];
assertEquals(input.read(buffer), 3);
assertEquals(new ArrayObject(buffer),
new ArrayObject(new byte[]{1, 2, 3}));
assertEquals(input.read(buffer), -1);
input.close();
try {
streamBuffer.getInput();
fail("cannot get input once closed");
} catch (Exception e) {
// success
}
}