[ 
https://issues.apache.org/jira/browse/COMPRESS-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15213535#comment-15213535
 ] 

Thomas Meyer commented on COMPRESS-207:
---------------------------------------

Hi,

regarding the bsGetBit change: what's a heads-up? what does this mean? sorry, I 
didn't want to be rude.

thanks for your work on this! I'll have a look at your branch.

regarding resetBlock method: This call is needed to position bit-exact on a 
bzip2-block. I'm not sure how to generalize this. An usage example is here:
https://github.com/thomasmey/OfflineWiki/blob/master/src/main/java/offlineWiki/pagestore/bzip2/BZip2Store.java#L128
and
https://github.com/thomasmey/OfflineWiki/blob/master/src/main/java/offlineWiki/pagestore/bzip2/BZip2RandomInputStream.java#L47

The idea is: through the listener you get the bit-exact bzip2 block position, 
and through an underlying random access of the compressed file you can seek to 
the correct byte position, and skip the remaining bits to start processing at 
the given bzip2 block.


> add notifier support for new block in BZip2CompressorInputStream
> ----------------------------------------------------------------
>
>                 Key: COMPRESS-207
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-207
>             Project: Commons Compress
>          Issue Type: New Feature
>          Components: Compressors
>    Affects Versions: 1.4.1
>            Reporter: Thomas Meyer
>            Priority: Minor
>              Labels: API, bzip
>         Attachments: 
> 0001-Add-notifier-support-for-new-block-in-BZip2Compresso.patch, 
> BZip2CompressorInputStream-add-newBlock-notifier.patch, 
> BZip2CompressorInputStream-add-newBlock-notifier.patch, 
> BZip2CompressorInputStream-add-newBlock-notifier.patch
>
>
> 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, currBlockPosition)
> - this = the current BZip2CompressorInputStream object
> - currBlockPosition = The offset (i.e. start position) in the compressed
> input stream of the current block



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to