After the C# object is converted into a byte array, extra bytes will appear. How to get rid of them? For example, if I convert it into a byte array, I want four bytes.
Just use the previous one. If you want to change
Byte[] b = new byte [4];
for(int I = 0; I<4; i++)
{
b[I]= a[I];
}