XD Plugin, getting file size before writing to disk

Hello, i was wondering, is there a way you could view the size of the image before you use “application.createRenditions(rendtionOptions);” ? is there perhaps a testRenditions method? Before i write the file to disk i want to see what the file size would be. Any help would be great.

You can use File I/O APIs to calculate size of the file by calculating lenght of binary file