I have a file that I want to split into 100 pieces.
The file size is 257019 bytes.
When running my splitter code below I get 99 parts with a size of 2545 byte and the last 100'th part is 5064 byte.
I need help to figure out how to make the first 99 parts having the same size and the last 100'th part having the leftover bytes that is equal or lower then 2545.
int partSize;
for(partSize=1 ;partSize< 257019; partSize++){
if((int) Math.ceil(257019 / partSize) == 100){
break;
}
}
int totalparts = (int) Math.ceil(257019 / partSize); // =100