public float GetFloat() { float result = new FastByte.Float().Read(data, absPosition, endianness); absPosition += sizeof(float); return(result); }
public float GetFloatAt(int offset) { const int bitCount = sizeof(float) * 8; if (absOffset + offset + bitCount > absLength) { throw new IndexOutOfRangeException(MsgIOORE(false, absOffset + offset, bitCount)); } var u = new FastBit.UInt(); u.Read(data, absOffset + offset, bitCount); var f = new FastByte.Float(u.b0, u.b1, u.b2, u.b3); return(!BitConverter.IsLittleEndian ? f.GetReversed() : f.value); }
public void PutAt(int offset, float value) { const int bitCount = sizeof(float) * 8; if (absOffset + offset + bitCount > absLength) { throw new IndexOutOfRangeException(MsgIOORE(true, absOffset + offset, bitCount)); } if (simulateWrites) { return; } if (!BitConverter.IsLittleEndian) { value = new FastByte.Float(value).GetReversed(); } var f = new FastByte.Float(value); new FastBit.UInt(f.b0, f.b1, f.b2, f.b3).Write(data, absOffset + offset, bitCount); }