private String getFormattedValues ( boolean readable , long size , long totalSize ) { // If size is 1, total size is 5, and readable is true, it will // return a string as "1B (20%)" int percent = totalSize == 0 ? 0 : ( int ) ( size * 100 / totalSize ) ; String subSizeMessage = readable ? FormatUtils . getSizeFromBytes ( size ) : String . valueOf ( size ) ; return String . format ( VALUE_AND_PERCENT_FORMAT , subSizeMessage , percent ) ; }
Gets the size and its percentage information if readable option is provided get the size in human readable format .