public static long calculateChunkedContentLength(long originalLength,long chunkSize){
  if (originalLength <= 0) {
    throw new IllegalArgumentException("Nonnegative content length expected.");
  }
  long maxSizeChunks=originalLength / chunkSize;
  long remainingBytes=originalLength % chunkSize;
  return maxSizeChunks * calculateChunkHeaderLength(chunkSize) + (remainingBytes > 0 ? calculateChunkHeaderLength(remainingBytes) : 0) + calculateChunkHeaderLength(0);
}

public static long calculateChunkedContentLength ( long originalLength , long chunkSize ) { if ( originalLength <= 0 ) { throw new IllegalArgumentException ( "Nonnegative content length expected." ) ; } long maxSizeChunks = originalLength / chunkSize ; long remainingBytes = originalLength % chunkSize ; return maxSizeChunks * calculateChunkHeaderLength ( chunkSize ) + ( remainingBytes > 0 ? calculateChunkHeaderLength ( remainingBytes ) : 0 ) + calculateChunkHeaderLength ( 0 ) ; }
calculates the expanded payload size of our data when it is chunked
