public OutputStream getCompressionStream ( String path ) throws IOException { File archivedFile = new File ( path ) ; archivedFile . createNewFile ( ) ; FileOutputStream fos = new FileOutputStream ( archivedFile ) ; BufferedOutputStream bufStr = new BufferedOutputStream ( fos ) ; // added bzip2 prefix fos . write ( "BZ" . getBytes ( ) ) ; CBZip2OutputStream bzip2 = new CBZip2OutputStream ( bufStr ) ; return bzip2 ; }
Creates stream for compression