Getting the size of the nth element in BinaryData

This feels like a silly question, but I can’t figure it out:

Can I get the size of the nth element stored in BinaryData? The reason is that I need to write several elements of the data to local files, with some code like this:

int assetsCount = BinaryData::namedResourceListSize;

for (int i=0; i < assetsCount; ++i){

assetFile = assetsDir.getChildFile(BinaryData::originalFilenames[i]);
FileOutputStream stream (assetFile);

bool writeOk = false;

if (stream.openedOk()){
    stream.setPosition (0);
    writeOk = stream.write(BinaryData::namedResourceList[i], BinaryData::<< namedResourceSizes[i] ?? >>);
    stream.flush() ;


Is there a way to access an array of namedResources sizes?

Thank you.

BinaryData::getNamedResource() can be used to query the size (numBytes) of a resource.

oh I see, by modifying the dataSizeInBytes reference argument.