I have a line of code written in C# that I need to convert to Vb.Net.
In C#
I have this block…
// Calculate number of 64K blocks
uint rowsPerBlock = _MAXBLOCK/widthLength;
uint blockSize = rowsPerBlock*widthLength;
uint blockCount;
ushort length;
uint remainder=dcSize;
Later the length variable is assigned a value and used for other calculations
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
All of the above I have converted, except the following line.
comp.Write(BitConverter.GetBytes((ushort)~length), 0, 2);
What would be the correct conversion for this line?
Thanks
This would use
Notin VB.Net to perform a bitwise negation: