Search Java Code Snippets


  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.





Java - Code Samples

 Sample 1. Code Sample / Example / Snippet of org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorInputStream

    public void testRemainingChunkTypes() throws Exception {

final FileInputStream isSz = new FileInputStream(getFile("mixed.txt.sz"));

final ByteArrayOutputStream out = new ByteArrayOutputStream();

try {

final FramedSnappyCompressorInputStream in = new FramedSnappyCompressorInputStream(isSz);

IOUtils.copy(in, out);

out.close();

} finally {

isSz.close();

}



assertArrayEquals(new byte[] { '1', '2', '3', '4',

'5', '6', '7', '8', '9',

'5', '6', '7', '8', '9',

'5', '6', '7', '8', '9',

'5', '6', '7', '8', '9',

'5', '6', '7', '8', '9', 10,

'1', '2', '3', '4',

'1', '2', '3', '4',

}, out.toByteArray());

}


   Like      Feedback      org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorInputStream



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner