File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,28 @@ makestream("data.txt.bz2")
110
110
makestream (" data.txt" )
111
111
```
112
112
113
+ Change the codec of a file
114
+ --------------------------
115
+
116
+ ` TranscodingStream ` s are composable: a stream can be an input/output of another
117
+ stream. You can use this to chage the codec of a file by composing different
118
+ codecs as below:
119
+ ``` julia
120
+ using CodecZlib
121
+ using CodecZstd
122
+
123
+ input = open (" data.txt.gz" , " r" )
124
+ output = open (" data.txt.zst" , " w" )
125
+
126
+ stream = GzipDecompressionStream (ZstdCompressionStream (output))
127
+ write (stream, input)
128
+ close (stream)
129
+ ```
130
+
131
+ Effectively, this is equivalent to the following pipeline:
132
+
133
+ cat data.txt.gz | gzip -d | zstd >data.txt.zst
134
+
113
135
Transcode data in one shot
114
136
--------------------------
115
137
You can’t perform that action at this time.
0 commit comments