A trait that represents an I/O stream (e.g., an I/O device) that can be written to in blocks.
The block size specifies the minimum granularity of each transfer,
as given by the
BlockWriter is not aware of the current block offset into the stream;
thus, each write operation requires a starting offset:
the number of blocks from the beginning of the I/O stream at which the write should start.
Writes blocks of data from the given
buffer to this writer.
The number of blocks written is dictated by the length of the given
buffer: the buffer from which data will be written. The length of this buffer must be a multiple of the block size.
block_offset: the offset in number of blocks from the beginning of this writer.
If successful, returns the number of blocks written to this writer. Otherwise, returns an error.
Flushes this entire writer’s output stream, ensuring all contents in intermediate buffers are fully written out.