Vb.Netに変換する必要があるC#で記述されたコード行があります。
C#では
私はこのブロックを持っています...
// Calculate number of 64K blocks
uint rowsPerBlock = _MAXBLOCK/widthLength;
uint blockSize = rowsPerBlock*widthLength;
uint blockCount;
ushort length;
uint remainder=dcSize;
その後、長さ変数に値が割り当てられ、他の計算に使用されます
length = (ushort)((remainder < blockSize) ? remainder : blockSize);
if (length == remainder)
{
comp.WriteByte(0x01);
}
else
{
comp.WriteByte(0x00);
}
comp.Write(BitConverter.GetBytes(length), 0, 2);
// Write one's compliment of LEN
次の行を除いて、上記のすべてを変換しました。
comp.Write(BitConverter.GetBytes((ushort)~length), 0, 2);
この行の正しい変換は何でしょうか?
ありがとう