public double GetDouble() { double result = new FastByte.Double().Read(data, absPosition, endianness); absPosition += sizeof(double); return(result); }
public double GetDoubleAt(int offset) { const int bitCount = sizeof(double) * 8; if (absOffset + offset + bitCount > absLength) { throw new IndexOutOfRangeException(MsgIOORE(false, absOffset + offset, bitCount)); } var u = new FastBit.ULong(); u.Read(data, absOffset + offset, bitCount); var f = new FastByte.Double(u.b0, u.b1, u.b2, u.b3, u.b4, u.b5, u.b6, u.b7); return(!BitConverter.IsLittleEndian ? f.GetReversed() : f.value); }
public void PutAt(int offset, double value) { const int bitCount = sizeof(double) * 8; if (absOffset + offset + bitCount > absLength) { throw new IndexOutOfRangeException(MsgIOORE(true, absOffset + offset, bitCount)); } if (simulateWrites) { return; } if (!BitConverter.IsLittleEndian) { value = new FastByte.Double(value).GetReversed(); } var f = new FastByte.Double(value); new FastBit.ULong(f.b0, f.b1, f.b2, f.b3, f.b4, f.b5, f.b6, f.b7).Write(data, absOffset + offset, bitCount); }