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

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

Introduction

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

Prototype

@Override
    public void write(final int b) 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);
    c.finish();/*from  www. j a va  2  s .  com*/
    c.flush();
    return os.toByteArray();
}