protected override void SetBoxChecksum(int box) { var boxOfs = GetBoxOffset(box) - ListHeaderSizeBox; var size = BoxSize - 2; var chk = Checksums.CheckSum16(new ReadOnlySpan <byte>(Data, boxOfs, size)); BigEndian.GetBytes(chk).CopyTo(Data, boxOfs + size); }
protected override void SetBoxChecksum(int i) { var boxOfs = GetBoxOffset(i) - ListHeaderSize; const int size = BoxSizeJ - 2; var chk = Checksums.CheckSum16(Data, boxOfs, size); BigEndian.GetBytes(chk).CopyTo(Data, boxOfs + size); }
protected override void SetBoxChecksum(int box) { var boxOfs = GetBoxOffset(box) - ListHeaderSize; const int size = BoxSizeJ - 2; var chk = Checksums.CheckSum16(new ReadOnlySpan <byte>(Data, boxOfs, size)); WriteUInt16BigEndian(Data.AsSpan(boxOfs + size), chk); }
protected override bool GetIsBoxChecksumValid(int box) { var boxOfs = GetBoxOffset(box) - ListHeaderSizeBox; var size = BoxSize - 2; var chk = Checksums.CheckSum16(new ReadOnlySpan <byte>(Data, boxOfs, size)); var actual = BigEndian.ToUInt16(Data, boxOfs + size); return(chk == actual); }
protected override bool GetIsBoxChecksumValid(int i) { var boxOfs = GetBoxOffset(i) - ListHeaderSize; const int size = BoxSizeJ - 2; var chk = Checksums.CheckSum16(Data, boxOfs, size); var actual = BigEndian.ToUInt16(Data, boxOfs + size); return(chk == actual); }