Ejemplo n.º 1
0
 // FloatCompressor
 public static void WriteFloat(this BitBuffer buffer, SingleCompressor compressor, float value)
 {
     if (compressor.RequiredBits > Config.VARINT_FALLBACK_SIZE)
     {
         buffer.WriteUInt(compressor.Pack(value));
     }
     else
     {
         buffer.Write(compressor.RequiredBits, compressor.Pack(value));
     }
 }
Ejemplo n.º 2
0
 public static float PeekFloat(this BitBuffer buffer, SingleCompressor compressor)
 {
     if (compressor.RequiredBits > Config.VARINT_FALLBACK_SIZE)
     {
         return(compressor.Unpack(buffer.PeekUInt()));
     }
     else
     {
         return(compressor.Unpack(buffer.Peek(compressor.RequiredBits)));
     }
 }