示例#1
0
        public static long PeekInt64(this RailBitBuffer buffer, RailInt64Compressor compressor)
        {
            if (compressor.RequiredBits > RailConfig.VARINT_FALLBACK_SIZE)
            {
                return(compressor.Unpack(buffer.PeekUInt64()));
            }

            return(compressor.Unpack(buffer.Peek(compressor.RequiredBits)));
        }
示例#2
0
 public static void WriteInt64(
     this RailBitBuffer buffer,
     RailInt64Compressor compressor,
     long value)
 {
     if (compressor.RequiredBits > RailConfig.VARINT_FALLBACK_SIZE)
     {
         buffer.WriteUInt64(compressor.Pack(value));
     }
     else
     {
         buffer.Write(compressor.RequiredBits, (uint)compressor.Pack(value));
     }
 }
示例#3
0
 public static void ReadInt64s(
     this RailBitBuffer buffer,
     RailInt64Compressor compressor,
     long[] toStore)
 {
     if (compressor.RequiredBits > RailConfig.VARINT_FALLBACK_SIZE)
     {
         for (int i = 0; i < toStore.Length; i++)
         {
             toStore[i] = compressor.Unpack(buffer.ReadUInt64());
         }
     }
     else
     {
         for (int i = 0; i < toStore.Length; i++)
         {
             toStore[i] = compressor.Unpack(buffer.Read(compressor.RequiredBits));
         }
     }
 }