readFully method
void
readFully(
- List bytes, {
- int? len,
- int? off,
- Endian endian = Endian.big,
})
Implementation
void readFully(List bytes, {int? len, int? off, Endian endian = Endian.big}) {
if (len != null || off != null) {
if ((len != null && off == null) || (len == null && off != null))
throw ArgumentError("You must supply both [len] and [off] values.");
if (len! < 0 || off! < 0)
throw RangeError("$off - $len is out of bounds");
if (len == 0) return;
}
if (len != null) {
bytes.addAll(data.getRange(off!, len));
} else {
fillList(bytes, readBytes(bytes.length));
}
}