Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » Binary Data » ReadBufferArrayFromBuffer

ReadBufferArrayFromBuffer


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

Splits chunk of data from byte buffer into array of buffers of equal sizes.

Syntax

void avl::ReadBufferArrayFromBuffer
(
	const avl::ByteBuffer& inBuffer,
	int inOffset,
	int inElementSize,
	int inElementsCount,
	atl::Array<avl::ByteBuffer>& outArray,
	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 inElementSize int 0 - 4 Length in bytes of single array element
Input value inElementsCount int 0 - 33554432 0 Amount of array elements to read
Output value outArray Array<ByteBuffer>& Buffers array with copied data
Output value outOffset int& Resulting position behind read data

Description

This filter can be helpful when reading an array from byte buffer. It can split a portion of data from the source buffer on the inBuffer input and split it into specified number of buffers returned on the outArray outputs. All buffers in the items of the output array must have the same size. Size of resulting buffers is specified by the inElementSize input. Number of buffers in the resulting array is specified by the inElementsCount input. Total number of bytes read by this filter can be calculated by multiplying the values from the inElementSize and inElementsCount inputs.

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.

This filter is usually a beginning of an array execution of other buffer reading filters.

Errors

List of possible exceptions:

Error type Description
IoError Empty byte buffer at input of ReadBufferArrayFromBuffer.
IoError Reading beyond the end of the byte buffer.
Source data range specified by the inOffset, inElementSize and inElementsCount inputs spans beyond the end of the byte buffer.

See Also