commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [compress] add notifier support for new block in BZip2CompressorInputStream
Date Mon, 29 Oct 2012 18:04:09 GMT
Thomas,

Please create a JIRA and describe and attach the patch there, with a unit
test if possible.

Thank you,
Gary

On Mon, Oct 29, 2012 at 1:02 PM, Thomas Meyer <thomas@m3y3r.de> wrote:

> Hi,
>
> attached patch enables an program to add a listener when a new bzip2
> block is detected.
>
> The notifier is called with:
>  - xxx.newBlock(this, currBlockNo, currBlockPosition)
>
> - this = the current BZip2CompressorInputStream object
> - currBlockNo = The current block number, increased for each block
> - currBlockPosition = The offset (i.e. start position) in the compressed
> input stream of the current block
>
> the "this" is send to enable the listener to get the number of read
> bytes in the uncompressed input stream via this.getBytesRead().
>
> With the attached patch a program can parse a bzip2 file and create an
> index of all bzip2 block offsets on the fly. This index can later on be
> used to skip to the correct block for faster positioning.
>
> comments are welcome.
>
> with kind regards
> thomas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message