# \[ANN\] TranscodingStreams.jl - new APIs to zlib, bzip2, xz, zstd and more!

**URL:** https://discourse.julialang.org/t/ann-transcodingstreams-jl-new-apis-to-zlib-bzip2-xz-zstd-and-more/4215
**Category:** Community
**Tags:** package, announcement
**Created:** [June 12, 2017, 6:53am UTC](https://discourse.julialang.org/t/ann-transcodingstreams-jl-new-apis-to-zlib-bzip2-xz-zstd-and-more/4215 "2017-06-12T06:53:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)
#### Post date: [June 12, 2017, 6:53am UTC](https://discourse.julialang.org/t/ann-transcodingstreams-jl-new-apis-to-zlib-bzip2-xz-zstd-and-more/4215/1 "2017-06-12T06:53:39Z")

</div>

Hi all,

I’d like to introduce my new packages: [TranscodingStreams.jl](https://github.com/bicycle1885/TranscodingStreams.jl) and its friends.

TranscodingStreams.jl is a package to make it simpler and more consistent to read/write encoded data stream. For example, if you use [Libz.jl](https://github.com/BioJulia/Libz.jl) (I am a maintainer of it) TranscodingStreams.jl and [CodecZlib.jl](https://github.com/bicycle1885/CodecZlib.jl) will be a drop-in replacement of it. Moreover, [CodecBzip2.jl](https://github.com/bicycle1885/CodecBzip2.jl), [CodecXz.jl](https://github.com/bicycle1885/CodecXz.jl), and [CodecZstd.jl](https://github.com/bicycle1885/CodecZstd.jl) support interfaces of TranscodingStremas.jl and hence you can use these all lossless compression algorithms without knowing the details.

Here is an example of reading a gzip-compressed file:

```julia
using CodecZlib
stream = GzipDecompressionStream(open("data.txt.gz"))
for line in eachline(stream)
    # do something...
end
close(stream)

```

If you want to read a bzip2-, xz-, or zstd-compressrd file instead of gzip in the example above, you can replace `GzipDecompressionStream` with `Bzip2DecompressionStream`, `XzDecompressionStream`, or `ZstdDecompressionStream`, respectively. These are all aliases to `TranscodingStream{C,S}` where `C<:Codec` and `S<:IO`, which is a subtype of `IO` and supports a range of I/O operations. More detailed explanation and examples can be found at the [docs](https://bicycle1885.github.io/TranscodingStreams.jl/stable/) of TranscodingStreams.jl.

These packages are still quite young and haven’t support Windows yet. I really appreciate pull requests to support Windows platforms if you have access to Windows. I hope to get feedbacks from users.

Thank you.

---

<div class="post-metadata">

### Author: ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)
#### Post date: [June 12, 2017, 7:03am UTC](https://discourse.julialang.org/t/ann-transcodingstreams-jl-new-apis-to-zlib-bzip2-xz-zstd-and-more/4215/2 "2017-06-12T07:03:09Z")

</div>

These look really useful, like a libarchive suite in Julia. And a small amount of code for each one, too.

---

<div class="post-metadata">

### Author: ![ihnorton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihnorton/32/26_2.png) [@ihnorton](https://discourse.julialang.org/u/ihnorton)
#### Post date: [August 18, 2017, 1:46am UTC](https://discourse.julialang.org/t/ann-transcodingstreams-jl-new-apis-to-zlib-bzip2-xz-zstd-and-more/4215/3 "2017-08-18T01:46:30Z")

</div>

A post was split to a new topic: [GzipDecompressionStream compared to GZip.jl?](https://discourse.julialang.org/t/gzipdecompressionstream-compared-to-gzip-jl/5442)
