示例#1
0
 private void WriteBits16(CtpObjectSymbols symbol, uint value)
 {
     m_buffer[m_length + 0] = (byte)symbol;
     m_buffer[m_length + 1] = (byte)(value >> 8);
     m_buffer[m_length + 2] = (byte)value;
     m_length += 3;
 }
示例#2
0
 private void WriteBits32(CtpObjectSymbols symbol, uint value)
 {
     m_buffer[m_length + 0] = (byte)symbol;
     m_buffer[m_length + 1] = (byte)(value >> 24);
     m_buffer[m_length + 2] = (byte)(value >> 16);
     m_buffer[m_length + 3] = (byte)(value >> 8);
     m_buffer[m_length + 4] = (byte)value;
     m_length += 5;
 }
示例#3
0
 private void WriteBits40(CtpObjectSymbols symbol, ulong value)
 {
     m_buffer[m_length + 0] = (byte)symbol;
     m_buffer[m_length + 1] = (byte)(value >> 32);
     m_buffer[m_length + 2] = (byte)(value >> 24);
     m_buffer[m_length + 3] = (byte)(value >> 16);
     m_buffer[m_length + 4] = (byte)(value >> 8);
     m_buffer[m_length + 5] = (byte)value;
     m_length += 6;
 }
示例#4
0
 private void WriteBits64(CtpObjectSymbols symbol, ulong value)
 {
     m_buffer[m_length + 0] = (byte)symbol;
     m_buffer[m_length + 1] = (byte)(value >> 56);
     m_buffer[m_length + 2] = (byte)(value >> 48);
     m_buffer[m_length + 3] = (byte)(value >> 40);
     m_buffer[m_length + 4] = (byte)(value >> 32);
     m_buffer[m_length + 5] = (byte)(value >> 24);
     m_buffer[m_length + 6] = (byte)(value >> 16);
     m_buffer[m_length + 7] = (byte)(value >> 8);
     m_buffer[m_length + 8] = (byte)value;
     m_length += 9;
 }
示例#5
0
 private void WriteArrayLength(CtpObjectSymbols baseSymbol, int length)
 {
     if (length > Bits24)
     {
         WriteBits32(baseSymbol + 3, (uint)length);
     }
     else if (length > Bits16)
     {
         WriteBits24(baseSymbol + 2, (uint)length);
     }
     else if (length > Bits8)
     {
         WriteBits16(baseSymbol + 1, (uint)length);
     }
     else
     {
         WriteBits8(baseSymbol + 0, (uint)length);
     }
 }
示例#6
0
 private void WriteNumericHelper(CtpObjectSymbols symbol, byte flags, uint value)
 {
     if (value > Bits24)
     {
         m_buffer[m_length + 0] = (byte)symbol;
         m_buffer[m_length + 1] = (byte)(flags + 192u);
         m_buffer[m_length + 2] = (byte)(value >> 24);
         m_buffer[m_length + 3] = (byte)(value >> 16);
         m_buffer[m_length + 4] = (byte)(value >> 8);
         m_buffer[m_length + 5] = (byte)value;
         m_length += 6;
     }
     else if (value > Bits16)
     {
         m_buffer[m_length + 0] = (byte)symbol;
         m_buffer[m_length + 1] = (byte)(flags + 128u);
         m_buffer[m_length + 2] = (byte)(value >> 16);
         m_buffer[m_length + 3] = (byte)(value >> 8);
         m_buffer[m_length + 4] = (byte)value;
         m_length += 5;
     }
     else if (value > Bits8)
     {
         m_buffer[m_length + 0] = (byte)symbol;
         m_buffer[m_length + 1] = (byte)(flags + 64u);
         m_buffer[m_length + 2] = (byte)(value >> 8);
         m_buffer[m_length + 3] = (byte)value;
         m_length += 4;
     }
     else
     {
         m_buffer[m_length + 0] = (byte)symbol;
         m_buffer[m_length + 1] = (byte)flags;
         m_buffer[m_length + 2] = (byte)value;
         m_length += 3;
     }
 }
示例#7
0
 private void WriteBits8(CtpObjectSymbols symbol, uint value)
 {
     m_buffer[m_length + 0] = (byte)symbol;
     m_buffer[m_length + 1] = (byte)value;
     m_length += 2;
 }
示例#8
0
 private void WriteSymbol(CtpObjectSymbols symbol)
 {
     m_buffer[m_length + 0] = (byte)symbol;
     m_length += 1;
 }