You are here: Start » Function Reference » All Functions » Binary Data » ReadDoubleFromBuffer
This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.
Header: | STD.h |
---|---|
Namespace: | fil |
Module: | FoundationLite |
Reads double value in specified binary format from a byte buffer.
Syntax
void fil::ReadDoubleFromBuffer ( const fil::ByteBuffer& inBuffer, int inOffset, fil::RealBinaryFormat::Type inFormat, double& outValue, int& outOffset )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inBuffer | const ByteBuffer& | Source data | ||
![]() |
inOffset | int | 0 - ![]() |
0 | Read start position |
![]() |
inFormat | RealBinaryFormat::Type | DoublePrecision_64Bit_LittleEndian.0f | Binary serialization format of floating point data | |
![]() |
outValue | double& | Read value | ||
![]() |
outOffset | int& | Resulting position behind read data |
Description
This filter is intended for reading (deserializing) a floating point value out of a raw binary data in a ByteBuffer.
Data is read starting at the position provided by the inOffset input (in bytes). This position is than advanced by the size of read data and returned on the outOffset output. This output can be connected to the inOffset input of other byte buffer reading filter when reading consecutive fields of data structures. When data read spans beyond the end of the input buffer an IOError is raised.
Double value is converted from a binary representation according to the inFormat input value:
- SinglePrecision_32Bit_LittleEndian - single precision floating point value, 4 bytes long with little-endian byte order.
- DoublePrecision_64Bit_LittleEndian - double precision floating point value, 8 bytes long with little-endian byte order.
- SinglePrecision_32Bit_BigEndian - single precision floating point value, 4 bytes long with big-endian byte order.
- DoublePrecision_64Bit_BigEndian - double precision floating point value, 8 bytes long with big-endian byte order.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Not supported floating point binary format. |
IoError | Empty byte buffer at input of ReadDoubleFromBuffer. |
IoError | Reading beyond the end of the byte buffer. Source data range specified by the inOffset input and the size of real binary format spans beyond the end of the byte buffer. |
See Also
- WriteRealToBuffer – Converts real value into specified binary representation and writes it to a byte buffer.