ReflectionUtils.newInstance(
conf.getClassByName("org.apache.hadoop.io.compress.SnappyCodec"), conf);
DataOutputBuffer compressedDataBuffer = new DataOutputBuffer();
CompressionOutputStream deflateFilter =
codec.createOutputStream(compressedDataBuffer);
byte[] data = new byte[1024];
DataOutputStream deflateOut = new DataOutputStream(
new BufferedOutputStream(deflateFilter));
deflateOut.write(data, 0, data.length);