number of bytes requested to be written to the buffer
        :returns: int -- number of bytes actually written
        r