toChunks method

List<ByteData> toChunks()

Implementation

List<ByteData> toChunks() {
  final writer = WriteStream();

  for (int i = 0; i < _magicHeader.length; ++i) {
    writer.writeByte(_magicHeader.codeUnitAt(i));
  }

  writer.writeInteger(_flags);
  writer.writeUtf8(_name);
  writer.writeInteger(_shallowSize);
  writer.writeInteger(_capacity);
  writer.writeInteger(_externalSize);

  _writeClasses(writer);
  _writeObjects(writer);
  _writeExternalProperties(writer);
  _writeIdentityHashCodes(writer);

  return writer.chunks;
}