add method

List<int> add(
  1. ByteData data
)

Appends a copy of data and returns [offset, length] for the header.

Implementation

List<int> add(ByteData data) {
  final offset = _bytes.length;
  _bytes.add(
    Uint8List.fromList(
      data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes),
    ),
  );
  return <int>[offset, data.lengthInBytes];
}