JuliaIO / GZip.jl

A Julia interface for gzip functions in zlib
https://juliaio.github.io/GZip.jl/dev
MIT License
39 stars 30 forks source link

`write(::GZipStream, ::UInt8)` has incorrect return value #93

Open lntricate1 opened 1 year ago

lntricate1 commented 1 year ago

Expected behavior: write should always return the number of bytes written. Actual behavior: write returns the value written, but only if the value is a UInt8. To reproduce:

using GZip

touch("test.gz")
GZip.open("test.gz", "w") do io
  write(io, 10)
end # Returns 8 as expected, since Int64 has 8 bytes.

GZip.open("test.gz", "w") do io
  write(io, 0xa)
end # Returns 10, but should return 1, since UInt8 has 1 byte.