Apache commons provides constants in the FileUtils
class, like
FileUtils.ONE_MB
FileUtils.ONE_GB
- …
source : https://commons.apache.org/proper/commons-io/javadocs/api-2.2/org/apache/commons/io/FileUtils.html
Their definition of a KB is based on 1024 bytes, (a MB is KB², and so long).