int 转byte[]
byte[] buffer = Encoding.ASCII.GetBytes(data);
byte[] temp = new byte[buffer.Length + 4];
temp[0] = (byte)(length & 0xFF);
temp[1] = (byte)((length & 0xFF00) >> 8);
temp[2] = (byte)((length & 0xFF0000) >> 16);
temp[3] = (byte)((length & 0xFF000000) >> 32);
Array.Copy(buffer, 0, temp, 4, buffer.Length);
byte[] 转int
tempBuffer = new byte[4];
Array.Copy(buffer, tempBuffer, 4);
lengthBuffer = tempBuffer[0] +
tempBuffer[1] * (int)Math.Pow(255, 1) +
tempBuffer[2] * (int)Math.Pow(255, 2) +
tempBuffer[3] * (int)Math.Pow(255, 3);