class CZstream
    # CZstream is not intended for use outside of the Zlib module

    class_primitive_nobridge 'open_read', 'openRead:errorClass:'
    class_primitive_nobridge 'open_write', 'openWrite:errorClass:comprLevel:'
    class_primitive_nobridge 'allocate', '_basicNew'

    primitive_nobridge 'read', 'read:'
    primitive_nobridge 'read_header', 'header'
    primitive_nobridge 'write_header', 'writeHeader:'
    primitive_nobridge 'at_eof', 'atEnd'
    primitive_nobridge 'total_out', 'position'
    primitive_nobridge 'close', 'close'
    primitive_nobridge '__flush', 'flush:'

    def flush(flags=nil)
      # flags == nil is equivalent to Z_FINISH
      self.__flush(flags)
    end

    primitive_nobridge 'write', 'rubyWrite:count:'

    primitive_nobridge '__open', 'open:io:errorClass:comprLevel:'

    class_primitive_nobridge '__adler32', 'adler32:initialCrc:'
    class_primitive_nobridge '__crc_table', 'crcTable'
    class_primitive_nobridge '__crc32', 'crc32:initialCrc:'
end
module Zlib

  ZStream = ::CZstream
end
Zlib.__freeze_constants
