Navigation: Developing Apps > BINETIX® AGE™ API > The Node > Toolkits > age_tools
binary_chunks/2
Description
binary_chunks/2 is an Erlang function exported by "age_tools" module.
Splits an input binary Data on chunks with a specified size (ChunkSize).
This function returns a list of chunks where the last one could be equal or less of the specified size.
References
None
Parameters
Name
Type
Input
binary()
Input binary sequence.
ChunkSize
integer()
Size of chunk.
Result
Value or Type
list()
Returns list of chunks without size prefixes.
Code Sample
> age_tools:binary_chunks(<<1,2,3,4,5,6,7,8,9,0>>, 4). [<<1,2,3,4>>, <<5,6,7,8>>, <<9,0>>]