safeRead<T> function

List<T> safeRead<T>(
  1. BufferPipe<T> pipe,
  2. int ref
)

Implementation

List<T> safeRead<T>(BufferPipe<T> pipe, int ref) {
  if (pipe.length < ref) {
    throw 'unexpected end of buffer';
  }
  return pipe.read(ref);
}