beginDoc method

int beginDoc({
  1. int schemaId = 0,
  2. int schemaVersion = 1,
})

Starts a document and returns its start offset.

Implementation

int beginDoc({int schemaId = 0, int schemaVersion = 1}) {
  if (_open) {
    throw StateError('a document is already open');
  }
  _ensure(vxsHeaderSize);
  _docStart = _pos;
  _pos += vxsHeaderSize;
  _schemaId = schemaId;
  _schemaVersion = schemaVersion;
  _lastFieldId = 0;
  _open = true;
  return _docStart;
}