Skip to main content

BZip2 in JAVA?

4 replies [Last post]
franske12
Offline
Joined: 2007-09-20
Points: 0

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
artemgr
Offline
Joined: 2004-06-18
Points: 0

There seems to be a Java implementation at http://www.kohsuke.org/bzip2/
It doesn't seem to be optimized, though. Compression seems to work several times slower than Java LZMA.

neunerball
Offline
Joined: 2005-11-22
Points: 0
franske12
Offline
Joined: 2007-09-20
Points: 0

Let me explain the question a little bit more. I'm reading a stream from the internet which is compressed in BZip2, so the stream contains bytes. I need to decompress those bytes to a normal text format. So far I found 1 library (CBZip2InputStream) but this is not really what i'm looking for cause it only accepts inputstreams. I need to reverse and decode the stream before I decompress it, so i need to turn it into an array. I thought of using a ByteArryInputStream but the stream is thousands of lines so that would be a huge ByteArray. An1 got ideas?

neunerball
Offline
Joined: 2005-11-22
Points: 0

Maybe that'll help http://www.bzip.org/