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 include only the remaining items.

Implementation

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