Skip to content

Commit d507a95

Browse files
authored
Update README.md
1 parent bfdb0ad commit d507a95

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

s2/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,14 @@ for each entry {
901901
}
902902
```
903903

904+
To decode from any given uncompressed offset `(wantOffset)`:
905+
906+
* Iterate entries until `entry[n].UncompressedOffset > wantOffset`.
907+
* Start decoding from `entry[n-1].CompressedOffset`.
908+
* Discard `entry[n-1].UncompressedOffset - wantOffset` bytes from the decoded stream.
909+
910+
See [using indexes](https://github.com/klauspost/compress/tree/master/s2#using-indexes) for functions that perform the operations with a simpler interface.
911+
904912
# Format Extensions
905913

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

0 commit comments

Comments
 (0)