}
@Test
public void testReadNotEnough() throws IOException {
// Ask for 5 bytes, only has 2
ExactSizeInputStream s = new ExactSizeInputStream(byteStream("he"), 5);
assertEquals(2, s.available());
assertEquals((int)'h', s.read());
assertEquals((int)'e', s.read());
try {
s.read();
fail("Read when should be out of data");
} catch (EOFException e) {
// expected
}
}