Back to Adaptive Vision Library website

You are here: Start » Function Reference » Binary Data » ReadRealFromBuffer

ReadRealFromBuffer


This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.

Reads real value in specified binary format from a byte buffer.

Syntax

void avl::ReadRealFromBuffer
(
	const avl::ByteBuffer& inBuffer,
	int inOffset,
	avl::RealBinaryFormat::Type inFormat,
	float& outValue,
	int& outOffset
)

Parameters

Name Type Range Default Description
inBuffer const ByteBuffer& Source data
inOffset int 0 - 0 Read start position
inFormat RealBinaryFormat::Type SinglePrecision_32Bit_LittleEndian.0f Binary serialization format of floating point data
outValue float& 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.

Real 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

Error type Description
IoError Empty byte buffer at input of ReadRealFromBuffer.
DomainError Not supported floating point binary format.
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.