'Inserts a string buffer as a record.
Example usage:
>>> record = mx.recordio.MXRecordIO(\'tmp.rec\', \'w\')
>>> for i in range(5):
...    record.write(\'record_%d\'%i)
>>> record.close()
Parameters
buf : string (python2), bytes (python3)
Buffer to write.'

def write(self, buf):

    assert self.writable
    check_call(_LIB.MXRecordIOWriterWriteRecord(self.handle, ctypes.c_char_p(buf), ctypes.c_size_t(len(buf))))
