Example usage for org.apache.hadoop.io.compress.bzip2 CBZip2OutputStream finish

List of usage examples for org.apache.hadoop.io.compress.bzip2 CBZip2OutputStream finish

Introduction

In this page you can find the example usage for org.apache.hadoop.io.compress.bzip2 CBZip2OutputStream finish.

Prototype

public void finish() throws IOException 

Source Link

Usage

From source file:org.wikimedia.wikihadoop.TestStreamWikiDumpInputFormat.java

License:Apache License

private static byte[] bzip2(byte[] bytes, int bsize) throws IOException {
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    CBZip2OutputStream c = new CBZip2OutputStream(os, bsize);
    c.write(bytes);/*from ww  w . j a  v  a 2  s.  c o m*/
    c.finish();
    c.flush();
    return os.toByteArray();
}