r2 = is.read(rbuf2);
assertEquals(rbuf2.length, r2);
- is.reset();
- r2 = is.read(rbuf2);
- assertEquals(rbuf2.length, r2);
+ try {
+ is.reset();
+ fail();
+ } catch (IOException expected) {
+ }
is.close();
// read a compressed entry
is = zfile.getInputStream(zentry2);
r1 = is.read(rbuf3);
assertEquals(4183, r1);
- is.reset();
-
- r1 = is.read(rbuf3);
- assertEquals(4183, r1);
+ try {
+ is.reset();
+ fail();
+ } catch (IOException expected) {
+ }
is.close();
is = zfile.getInputStream(zentry2);
r1 = is.read(rbuf3, 0, 3000);
assertEquals(3000, r1);
- is.reset();
- r1 = is.read(rbuf3, 0, 3000);
- assertEquals(3000, r1);
+ try {
+ is.reset();
+ fail();
+ } catch (IOException expected) {
+ }
is.close();
}
assertEquals(8, r);
assertEquals(-1, is.read());
- is.reset();
- r = is.read(rbuf2);
- assertEquals(8, r);
- assertEquals(-1, is.read());
+ try {
+ is.reset();
+ fail();
+ } catch (IOException expected) {
+ }
+
is.close();
// read a compressed entry
assertEquals(1183, r);
assertEquals(-1, is.read());
- is.reset();
- r = is.read(rbuf3);
- assertEquals(1183, r);
- assertEquals(-1, is.read());
+ try {
+ is.reset();
+ fail();
+ } catch (IOException expected) {
+ }
+
is.close();
}