code: def write(self, byte):
          
          if self.is_closed_flag:
              raise Exception("Unable to write - already closed!")
          self.written += len(byte)
          self.file.write(byte)
docs: Writes a byte buffer to the underlying output file.
          Raise exception when file is already closed.