| |
 |
|
|
Science Forum Index » Compression Forum » separation of blocks in gzip
Page 1 of 1
|
| Author |
Message |
| Guest |
Posted: Tue Apr 22, 2008 3:42 pm |
|
|
|
|
How do I determine where a new block begin in gzip?
in the deflate rfc specification it says there is an end-of-block
literal (256), how can i find this value in the file?
if i use an hex editor should it just be 0x100?
thanks
k |
|
|
| Back to top |
|
| Mark Adler |
Posted: Tue Apr 22, 2008 7:04 pm |
|
|
|
Guest
|
On Apr 22, 6:42 pm, kooshb...@gmail.com wrote:
Quote: How do I determine where a new block begin in gzip?
Why do you care?
In order to find it, you need to decode the stream completely. You
can't just search for something. 256 is the symbol number, not how
it's coded in the stream. How it's coded is variable from dynamic
block to dynamic block, the number of bits is also variable, and it
may start on any bit boundary. Even knowing that, you can't search
for it, since that bit pattern can occur as parts of other codes
concatenated.
If you really need to know, zlib's inflate has an option Z_BLOCK that
will return whenever it encounters a block boundary.
Mark |
|
|
| Back to top |
|
| |
|
Page 1 of 1
All times are GMT - 5 Hours
The time now is Wed Aug 20, 2008 5:39 am
|
|