Here you can find the source of bytesToKBytes(long bytes)
public static long bytesToKBytes(long bytes)
//package com.java2s; //License from project: Open Source License public class Main { public static long bytesToKBytes(long bytes) { long kBytes = bytes / 1024; long remainder = bytes % 1024; if (remainder > 0) kBytes += 1;//from w ww . j a v a 2 s .c o m return kBytes; } }