*/
public static byte[] compressBZip2(byte[] bytes) {
try {
InputStream bytesIS = new ByteArrayInputStream(bytes);
ByteArrayOutputStream bytesCompressedOS = new ByteArrayOutputStream();
BZip2CompressorOutputStream bzip2CompressorOS = new BZip2CompressorOutputStream(bytesCompressedOS);
ByteStreams.copy(bytesIS, bzip2CompressorOS);
bzip2CompressorOS.close();
return bytesCompressedOS.toByteArray();
} catch (IOException e) {
logger.log(Level.SEVERE, "Error while compressing", e);
return null;