static void EncodeInt32 (byte[] buf, ref int index, int value) { buf[index++] = (byte) (value); buf[index++] = (byte) (value >> 8); buf[index++] = (byte) (value >> 16); buf[index++] = (byte) (value >> 24); }