@Test
public void testRead() throws IOException {
bytesOut = new ByteArrayOutputStream();
BlockCompressorStream blockCompressorStream =
new BlockCompressorStream(bytesOut,
new FakeCompressor(), 1024, 0);
blockCompressorStream.close();
buf = bytesOut.toByteArray();
assertEquals("empty file compressed output size is not 4", 4, buf.length);
bytesIn = new ByteArrayInputStream(buf);
BlockDecompressorStream blockDecompressorStream =
new BlockDecompressorStream(bytesIn, new FakeDecompressor(), 1024);
try {
assertEquals("return value is not -1",
-1 , blockDecompressorStream.read());
} catch (IOException e) {
fail("unexpected IOException : " + e);
}
}
}