Start » Filter Reference » System » Binary Data » ReadBufferArrayFromBuffer

ReadBufferArrayFromBuffer


Module: FoundationLite

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

Name Type Range Description
Input value
inBuffer ByteBuffer Source data
Input value
inOffset Integer 0 - Read start position
Input value
inElementSize Integer 0 - Length in bytes of single array element
Input value
inElementsCount Integer 0 - 33554432 Amount of array elements to read
Output value
outArray ByteBufferArray Buffers array with copied data
Output value
outOffset Integer 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

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
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.

Complexity Level

This filter is available on Basic Complexity Level.

Filter Group

This filter is member of ReadFromBuffer filter group.

See Also