Add "random access" definition to ractool docs

This commit is contained in:
Nigel Tao committed 2019-08-24 15:41:35 +10:00
1 parent 874f5a1712
commit f75a10a230
3 files changed
+27 -4

No files matched your search

+15 -1
View File
@@ -16,7 +16,21 @@
package main
const usageStr = `Usage:
const usageStr = `ractool manipulates Random Access Compression (RAC) files.
Random access means that it is possible to reconstruct part of the decompressed
file, starting at a given offset into the decompressed file, without always
having to first decompress all of the preceding data.
In comparison to some other popular compression formats, all three of the Zlib,
Brotli and Zstandard specifications (RFCs 1950, 7932 and 8478) explicitly
contain the identical phrase: "the data format defined by this specification
does not attempt to allow random access to compressed data".
See the RAC specification for more details:
https://github.com/google/wuffs/blob/master/doc/spec/rac-spec.md
Usage:
ractool [flags] [input_filename]
+3 -3
View File
@@ -41,13 +41,13 @@ func main1() error {
return err
}
if i := bytes.Index(src, []byte("Usage:\n\n")); i < 0 {
return fmt.Errorf(`couldn't find "Usage" sub-string`)
if i := bytes.Index(src, []byte("ractool manipulates ")); i < 0 {
return fmt.Errorf(`couldn't find documentation sub-string`)
} else {
src = src[i:]
}
if j := bytes.Index(src, []byte("*/")); j < 0 {
return fmt.Errorf(`couldn't find "Usage" sub-string`)
return fmt.Errorf(`couldn't find documentation sub-string`)
} else {
src = src[:j]
}
+9
View File
@@ -19,6 +19,15 @@
/*
ractool manipulates Random Access Compression (RAC) files.
Random access means that it is possible to reconstruct part of the decompressed
file, starting at a given offset into the decompressed file, without always
having to first decompress all of the preceding data.
In comparison to some other popular compression formats, all three of the Zlib,
Brotli and Zstandard specifications (RFCs 1950, 7932 and 8478) explicitly
contain the identical phrase: "the data format defined by this specification
does not attempt to allow random access to compressed data".
See the RAC specification for more details:
https://github.com/google/wuffs/blob/master/doc/spec/rac-spec.md