def METHOD_NAME(self, timestamp, key, value, headers=[]):
    """ Append a message to the buffer.
    Returns: RecordMetadata or None if unable to append
    """
    if self._closed:
        return None
    offset = self._next_offset
    metadata = self._builder.METHOD_NAME(offset, timestamp, key, value, headers)
    # Return of None means there's no space to add a new message
    if metadata is None:
        return None
    self._next_offset += 1
    return metadata