def _Close(self):
    """Closes the file-like object.

    If the file-like object was passed in the init function
    the encoded stream file-like object does not control
    the file-like object and should not actually close it.
    """
    if not self._file_object_set_in_init:
      self._file_object.close()
      self._file_object = None

    self._decoder = None
    self._decoded_data = b''
    self._encoded_data = b''