private static U32 S32ToU32(S32 buffer) { U32 result; result._length = buffer._length; result._value = (uint)buffer._value; return(result); }
public static void WriteS32(BinaryWriter writer, S32 value) { if (0 == value._value) { writer.Write((byte)0); return; } uint b0 = (uint)value._value; byte b1; while (b0 != 0) { b1 = (byte)(b0 & 0x7f); b0 >>= 7; if (b0 != 0) { b1 |= 0x80; } writer.Write(b1); } }