public static long ReadInt64(this RailBitBuffer buffer, RailInt64Compressor compressor) { if (compressor.RequiredBits > RailConfig.VARINT_FALLBACK_SIZE) { return(compressor.Unpack(buffer.ReadUInt64())); } return(compressor.Unpack(buffer.Read(compressor.RequiredBits))); }
private void ReadWriteUInt64(ulong expected) { RailBitBuffer buffer = new RailBitBuffer(); buffer.WriteUInt64(expected); ulong actual = buffer.ReadUInt64(); Assert.Equal(expected, actual); }
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)); } } }