copyFrom method

int copyFrom(
  1. TStream source,
  2. int count
)

Implementation

int copyFrom(TStream source, int count) {
  if (count <= 0) {
    source.position = 0;
    count = source.size;
  }
  final buf = List<int>.filled(count, 0);
  final n = source.read(buf, count);
  write(buf, n);
  return n;
}