Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Jul 22, 2022
1 parent 670fdac commit eb9e465
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 @@ -835,6 +835,13 @@ This is done using the regular "Skip" function:

This will ensure that we are at exactly the offset we want, and reading from `dec` will start at the requested offset.

# Compact storage

For compact storage [RemoveIndexHeaders](https://pkg.go.dev/github.com/klauspost/compress/s2#RemoveIndexHeaders) can be used to remove any redundant info from
a serialized index. If you remove the header it must be restored before [Loading](https://pkg.go.dev/github.com/klauspost/compress/s2#Index.Load).

This is expected to save 20 bytes. These can be restored using [RestoreIndexHeaders](https://pkg.go.dev/github.com/klauspost/compress/s2#RestoreIndexHeaders). This removes a layer of security, but is the most compact representation. Returns nil if headers contains errors.

## Index Format:

Each block is structured as a snappy skippable block, with the chunk ID 0x99.
Expand Down Expand Up @@ -929,6 +936,7 @@ To decode from any given uncompressed offset `(wantOffset)`:

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 eb9e465

Please sign in to comment.