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

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

Introduction

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

Prototype

@Override
    public void flush() 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 w  ww  .ja  v  a2  s.com
    c.finish();
    c.flush();
    return os.toByteArray();
}