ArrayInt16.fromReader constructor

ArrayInt16.fromReader(
  1. BinaryReader reader,
  2. int numShorts
)

Implementation

factory ArrayInt16.fromReader(BinaryReader reader, int numShorts) {
  ByteData? data = reader.read(numShorts * 2);

  if (data == null) {
    throw "hit end of data";
  }

  return ArrayInt16(bytes: data);
}