public override int GetRecord(int recordID) { int ofs = Records.GetOffset(Offset, recordID); if (recordID < 100) { return(BitConverter.ToInt32(Data, ofs)); } if (recordID < 200) { return(BitConverter.ToInt16(Data, ofs)); } Trace.Fail(nameof(recordID)); return(0); }
public override int GetRecord(int recordID) { int ofs = Records.GetOffset(Offset, recordID); switch (recordID) { case < 100: return(ReadInt32LittleEndian(Data.AsSpan(ofs))); case < 200: return(ReadInt16LittleEndian(Data.AsSpan(ofs))); default: Trace.Fail(nameof(recordID)); return(0); } }
public override int GetRecord(int recordID) { int ofs = Records.GetOffset(Offset, recordID); switch (recordID) { case < 100: return(BitConverter.ToInt32(Data, ofs)); case < 200: return(BitConverter.ToInt16(Data, ofs)); default: Trace.Fail(nameof(recordID)); return(0); } }
public int GetRecordOffset(int recordID) => Records.GetOffset(Offset, recordID);