subset method

InputBuffer subset(
  1. int count, {
  2. int? position,
  3. int offset = 0,
})

Return a InputStream to read a subset of this stream. It does not move the read position of this stream. position is specified relative to the start of the buffer. If position is not specified, the current read position is used. If length is not specified, the remainder of this stream is used.

Implementation

InputBuffer subset(int count, {int? position, int offset = 0}) {
  var pos = position != null ? start + position : this.offset;
  pos += offset;

  return InputBuffer(buffer,
      bigEndian: bigEndian, offset: pos, length: count);
}