Creates a new Buffer from a region of this buffer.
this
If slice == true the returned buffer is resized to the current offset.
slice
Buffer toBuffer({required final bool slice}) => buffer.slice(0, slice ? offset : null);