diff options
author | appilon <apilon@hashicorp.com> | 2019-02-27 16:43:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-27 16:43:31 -0500 |
commit | 844b5a68d8af4791755b8f0ad293cc99f5959183 (patch) | |
tree | 255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/github.com/ulikunitz/xz/README.md | |
parent | 303b299eeb6b06e939e35905e4b34cb410dd9dc3 (diff) | |
parent | 15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (diff) | |
download | terraform-provider-statuscake-844b5a68d8af4791755b8f0ad293cc99f5959183.tar.gz terraform-provider-statuscake-844b5a68d8af4791755b8f0ad293cc99f5959183.tar.zst terraform-provider-statuscake-844b5a68d8af4791755b8f0ad293cc99f5959183.zip |
Merge pull request #27 from terraform-providers/go-modules-2019-02-22
[MODULES] Switch to Go Modules
Diffstat (limited to 'vendor/github.com/ulikunitz/xz/README.md')
-rw-r--r-- | vendor/github.com/ulikunitz/xz/README.md | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/vendor/github.com/ulikunitz/xz/README.md b/vendor/github.com/ulikunitz/xz/README.md new file mode 100644 index 0000000..969ae7a --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/README.md | |||
@@ -0,0 +1,71 @@ | |||
1 | # Package xz | ||
2 | |||
3 | This Go language package supports the reading and writing of xz | ||
4 | compressed streams. It includes also a gxz command for compressing and | ||
5 | decompressing data. The package is completely written in Go and doesn't | ||
6 | have any dependency on any C code. | ||
7 | |||
8 | The package is currently under development. There might be bugs and APIs | ||
9 | are not considered stable. At this time the package cannot compete with | ||
10 | the xz tool regarding compression speed and size. The algorithms there | ||
11 | have been developed over a long time and are highly optimized. However | ||
12 | there are a number of improvements planned and I'm very optimistic about | ||
13 | parallel compression and decompression. Stay tuned! | ||
14 | |||
15 | # Using the API | ||
16 | |||
17 | The following example program shows how to use the API. | ||
18 | |||
19 | package main | ||
20 | |||
21 | import ( | ||
22 | "bytes" | ||
23 | "io" | ||
24 | "log" | ||
25 | "os" | ||
26 | |||
27 | "github.com/ulikunitz/xz" | ||
28 | ) | ||
29 | |||
30 | func main() { | ||
31 | const text = "The quick brown fox jumps over the lazy dog.\n" | ||
32 | var buf bytes.Buffer | ||
33 | // compress text | ||
34 | w, err := xz.NewWriter(&buf) | ||
35 | if err != nil { | ||
36 | log.Fatalf("xz.NewWriter error %s", err) | ||
37 | } | ||
38 | if _, err := io.WriteString(w, text); err != nil { | ||
39 | log.Fatalf("WriteString error %s", err) | ||
40 | } | ||
41 | if err := w.Close(); err != nil { | ||
42 | log.Fatalf("w.Close error %s", err) | ||
43 | } | ||
44 | // decompress buffer and write output to stdout | ||
45 | r, err := xz.NewReader(&buf) | ||
46 | if err != nil { | ||
47 | log.Fatalf("NewReader error %s", err) | ||
48 | } | ||
49 | if _, err = io.Copy(os.Stdout, r); err != nil { | ||
50 | log.Fatalf("io.Copy error %s", err) | ||
51 | } | ||
52 | } | ||
53 | |||
54 | # Using the gxz compression tool | ||
55 | |||
56 | The package includes a gxz command line utility for compression and | ||
57 | decompression. | ||
58 | |||
59 | Use following command for installation: | ||
60 | |||
61 | $ go get github.com/ulikunitz/xz/cmd/gxz | ||
62 | |||
63 | To test it call the following command. | ||
64 | |||
65 | $ gxz bigfile | ||
66 | |||
67 | After some time a much smaller file bigfile.xz will replace bigfile. | ||
68 | To decompress it use the following command. | ||
69 | |||
70 | $ gxz -d bigfile.xz | ||
71 | |||