GZip.jl icon indicating copy to clipboard operation
GZip.jl copied to clipboard

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

Open lntricate1 opened this issue 3 years ago • 0 comments

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.

lntricate1 avatar Feb 14 '23 03:02 lntricate1