public decimal ReadDecimal() { UIntDecimal converter = new UIntDecimal(); converter.longValue1 = ReadUInt64(); converter.longValue2 = ReadUInt64(); return(converter.decimalValue); }
public void Write(decimal value) { // the only way to read it without allocations is to both read and // write it with the FloatConverter (which is not binary compatible // to writer.Write(decimal), hence why we use it here too) UIntDecimal converter = new UIntDecimal { decimalValue = value }; Write(converter.longValue1); Write(converter.longValue2); }