'Initialize for reading a gzip compressed fileobj.'

def _init_read_gz(self):

    self.cmp = self.zlib.decompressobj((- self.zlib.MAX_WBITS))
    self.dbuf = ''
    if (self.__read(2) != '\x1f\x8b'):
        raise ReadError('not    a    gzip    file')
    if (self.__read(1) != '\x08'):
        raise CompressionError('unsupported    compression    method')
    flag = ord(self.__read(1))
    self.__read(6)
    if (flag & 4):
        xlen = (ord(self.__read(1)) + (256 * ord(self.__read(1))))
        self.read(xlen)
    if (flag & 8):
        while True:
            s = self.__read(1)
            if ((not s) or (s == NUL)):
                break
    if (flag & 16):
        while True:
            s = self.__read(1)
            if ((not s) or (s == NUL)):
                break
    if (flag & 2):
        self.__read(2)
