set s [string repeat A 5000]
set cs [zlib gzip $s]
puts stderr "Compressed size is [string length $cs]"

foreach {pr pw} [chan pipe] break
fconfigure $pw -buffering full -translation binary
fconfigure $pr -translation binary

puts $pw hahaha
puts -nonewline $pw $cs
flush $pw
close $pw

puts stderr HEADER:[gets $pr]
zlib push gunzip $pr
puts stderr "Now reading through gunzip"
set data [read $pr]
puts stderr "Received [string length $data] out of [string length $s]"


