toBuffer method

Buffer toBuffer({
  1. required bool slice,
})

Creates a new Buffer from a region of this buffer.

If slice == true the returned buffer is resized to the current offset.

Implementation

Buffer toBuffer({required final bool slice}) =>
    buffer.slice(0, slice ? offset : null);