Back to Adaptive Vision Studio website

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

ReadRealFromBuffer


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

Name Type Range Description
inBuffer ByteBuffer Source data
inOffset Integer 0 - Read start position
inFormat RealBinaryFormat Binary serialization format of floating point data
outValue Real Read value
outOffset Integer 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

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

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.

Complexity Level

This filter is available on Basic Complexity Level.

Filter Group

This filter is member of ReadFromBuffer filter group.

See Also

  • WriteRealToBuffer – Converts real value into specified binary representation and writes it to a byte buffer.