MemPtr.from constructor Null safety

MemPtr.from(
  1. MemPtr other,
  2. [int offset = 0,
  3. int _length = -1]
)

Implementation

MemPtr.from(MemPtr other, [this.offset = 0, this._length = -1])
    : buffer = other.buffer,
      byteOrder = other.byteOrder {
  offset += other.offset;
  if (_length < 0) {
    _length = other.length;
  }
  if (_length > buffer.length) {
    _length = buffer.length;
  }
}