Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » 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.

Header: STD.h
Namespace: avl
Module: FoundationLite

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

List of possible exceptions:

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