/// <summary>
 /// Read the data and check if the offset is correct.
 /// </summary>
 /// <param name="offset">the desired offset</param>
 /// <param name="packet">the reading packet</param>
 /// <returns>The new offset after the data</returns>
 internal int ReadData(int offset, ReadPacket packet)
 {
     if (offset != this.offset)
     {
         throw new IOException("Invalid Record Offset");
     }
     data = packet.ReadBytes(size);
     return offset + size;
 }