public override void Deserialize(AdhocFile parent, ref SpanReader sr) { ElemCount = sr.ReadUInt32(); if (parent.Version > 11) { UnkBool = sr.ReadBoolean(); } }
public (SpecDBRowData Row, bool ReadAll) ReadRow(Span <byte> rowData, Endian endian) { var sr = new SpanReader(rowData, endian); var row = new SpecDBRowData(); foreach (var columnMeta in Columns) { switch (columnMeta.ColumnType) { case DBColumnType.Bool: row.ColumnData.Add(new DBBool(sr.ReadBoolean())); break; case DBColumnType.Byte: row.ColumnData.Add(new DBByte(sr.ReadByte())); break; case DBColumnType.SByte: row.ColumnData.Add(new DBSByte(sr.ReadSByte())); break; case DBColumnType.Short: row.ColumnData.Add(new DBShort(sr.ReadInt16())); break; case DBColumnType.UShort: row.ColumnData.Add(new DBUShort(sr.ReadUInt16())); break; case DBColumnType.Int: row.ColumnData.Add(new DBInt(sr.ReadInt32())); break; case DBColumnType.UInt: row.ColumnData.Add(new DBUInt(sr.ReadUInt32())); break; case DBColumnType.Long: row.ColumnData.Add(new DBLong(sr.ReadInt64())); break; case DBColumnType.Float: row.ColumnData.Add(new DBFloat(sr.ReadSingle())); break; case DBColumnType.String: row.ColumnData.Add(new DBString(sr.ReadInt32(), columnMeta.StringFileName)); break; default: break; } } return(row, sr.IsEndOfSpan); }