Exemplo n.º 1
0
 public static int PeekInt(
   this RailBitBuffer buffer,
   RailIntCompressor compressor)
 {
   if (compressor.RequiredBits > RailConfig.VARINT_FALLBACK_SIZE)
     return compressor.Unpack(buffer.PeekUInt());
   else
     return compressor.Unpack(buffer.Peek(compressor.RequiredBits));
 }
Exemplo n.º 2
0
 public static void WriteInt(
   this RailBitBuffer buffer,
   RailIntCompressor compressor,
   int value)
 {
   if (compressor.RequiredBits > RailConfig.VARINT_FALLBACK_SIZE)
     buffer.WriteUInt(compressor.Pack(value));
   else
     buffer.Write(compressor.RequiredBits, compressor.Pack(value));
 }