def write(data)
      make_header unless header_finished?

      data = String data

      if data.length > 0 or sync? then
        @crc = Zlib.crc32_c @crc, data, data.length

        flush = sync? ? Zlib::SYNC_FLUSH : Zlib::NO_FLUSH

        @zstream.run data, flush
      end

      write_raw
    end
def write(data)
      make_header unless header_finished?

      data = String data

      if data.length > 0 or sync? then
        @crc = Zlib.crc32_c @crc, data, data.length

        flush = sync? ? Zlib::SYNC_FLUSH : Zlib::NO_FLUSH

        @zstream.run data, flush
      end

      write_raw
    end
Same as IO.