safeRead<T> function
Implementation
List<T> safeRead<T>(BufferPipe<T> pipe, int ref) {
if (pipe.length < ref) {
throw RangeError.range(
pipe.length,
ref,
null,
'pipe',
'Unexpected end of buffer',
);
}
return pipe.read(ref);
}