summaryrefslogtreecommitdiff
path: root/vendor/github.com/ulikunitz/xz/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/ulikunitz/xz/README.md')
-rw-r--r--vendor/github.com/ulikunitz/xz/README.md72
1 files changed, 37 insertions, 35 deletions
diff --git a/vendor/github.com/ulikunitz/xz/README.md b/vendor/github.com/ulikunitz/xz/README.md
index 969ae7a00..0a2dc8284 100644
--- a/vendor/github.com/ulikunitz/xz/README.md
+++ b/vendor/github.com/ulikunitz/xz/README.md
@@ -12,46 +12,48 @@ have been developed over a long time and are highly optimized. However
there are a number of improvements planned and I'm very optimistic about
parallel compression and decompression. Stay tuned!
-# Using the API
+## Using the API
The following example program shows how to use the API.
- package main
-
- import (
- "bytes"
- "io"
- "log"
- "os"
-
- "github.com/ulikunitz/xz"
- )
-
- func main() {
- const text = "The quick brown fox jumps over the lazy dog.\n"
- var buf bytes.Buffer
- // compress text
- w, err := xz.NewWriter(&buf)
- if err != nil {
- log.Fatalf("xz.NewWriter error %s", err)
- }
- if _, err := io.WriteString(w, text); err != nil {
- log.Fatalf("WriteString error %s", err)
- }
- if err := w.Close(); err != nil {
- log.Fatalf("w.Close error %s", err)
- }
- // decompress buffer and write output to stdout
- r, err := xz.NewReader(&buf)
- if err != nil {
- log.Fatalf("NewReader error %s", err)
- }
- if _, err = io.Copy(os.Stdout, r); err != nil {
- log.Fatalf("io.Copy error %s", err)
- }
+```go
+package main
+
+import (
+ "bytes"
+ "io"
+ "log"
+ "os"
+
+ "github.com/ulikunitz/xz"
+)
+
+func main() {
+ const text = "The quick brown fox jumps over the lazy dog.\n"
+ var buf bytes.Buffer
+ // compress text
+ w, err := xz.NewWriter(&buf)
+ if err != nil {
+ log.Fatalf("xz.NewWriter error %s", err)
}
+ if _, err := io.WriteString(w, text); err != nil {
+ log.Fatalf("WriteString error %s", err)
+ }
+ if err := w.Close(); err != nil {
+ log.Fatalf("w.Close error %s", err)
+ }
+ // decompress buffer and write output to stdout
+ r, err := xz.NewReader(&buf)
+ if err != nil {
+ log.Fatalf("NewReader error %s", err)
+ }
+ if _, err = io.Copy(os.Stdout, r); err != nil {
+ log.Fatalf("io.Copy error %s", err)
+ }
+}
+```
-# Using the gxz compression tool
+## Using the gxz compression tool
The package includes a gxz command line utility for compression and
decompression.