From 3b3b1f3da5d725677e832d3122cc1164103e68ca Mon Sep 17 00:00:00 2001 From: Sam O'Connor Date: Fri, 22 Jan 2016 09:01:17 +1100 Subject: [PATCH] Update README.md with examples per #12 --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index ca23a0b..59b8a89 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,21 @@ close(io) # pointlessly compress and decompress some data readbytes(rand(UInt8, 10000) |> ZlibDeflateInputStream |> ZlibInflateInputStream) + +# convenience functions +writegz("data.txt.gz", "Hello!") +string = readgzstring("data.txt.gz") + +writegz("data.bin.gz", rand(UInt8, 10000)) +bytes = readgz("data.bin.gz") + +s = gzopen("data.bin.gz") +bytes = read(s) +close(s) + +gzopen("data.bin.gz", "w") do s + write(s, rand(UInt8, 10000)) +end ``` ## Other functions