public static int getChunkSize ( BoxUploadSession uploadSession , int partNumber , long fileSize ) { if ( partNumber == uploadSession . getTotalParts ( ) - 1 ) { return ( int ) ( fileSize - partNumber * uploadSession . getPartSize ( ) ) ; } return uploadSession . getPartSize ( ) ; }
Computes the actual bytes to be sent in a part which equals the partsize for all parts except the last .