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)); }
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)); }