Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed May 10, 2022
1 parent bfdb0ad commit d507a95
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions s2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,14 @@ for each entry {
}
```

To decode from any given uncompressed offset `(wantOffset)`:

* Iterate entries until `entry[n].UncompressedOffset > wantOffset`.
* Start decoding from `entry[n-1].CompressedOffset`.
* Discard `entry[n-1].UncompressedOffset - wantOffset` bytes from the decoded stream.

See [using indexes](https://github.com/klauspost/compress/tree/master/s2#using-indexes) for functions that perform the operations with a simpler interface.

# Format Extensions

* Frame [Stream identifier](https://github.com/google/snappy/blob/master/framing_format.txt#L68) changed from `sNaPpY` to `S2sTwO`.
Expand Down

0 comments on commit d507a95

Please sign in to comment.