docs: def close(self):
          '''
          Closes the stream to output. It destroys the buffer and the buffer pointer. However, it will not close the the client connection
          '''
          #write all that is remained in buffer
          self.flush()
          # delete buffer
          self.__buffer = None
          #reset buffer index to -1 to indicate no where
          self.__bufferidx = -1
          #writing the final empty chunk to the socket
          # send here the data
          self.conn.send("0\r\n")
          self.conn.send("\r\n" )
          #set closed flag
          self.__closed = True