com.imcode.util
Class HumanReadable

java.lang.Object
  extended by com.imcode.util.HumanReadable

public class HumanReadable
extends java.lang.Object

Utilities for preparing data for human consumption.


Constructor Summary
HumanReadable()
           
 
Method Summary
static java.lang.String getHumanReadableByteSize(long size)
          Format a byte size like for example "1 kB" or "1.5 MB".
static java.lang.String getHumanReadableTimeSpan(long milliseconds)
          Format a time span like for example "3h, 4m, 5s, 60ms"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HumanReadable

public HumanReadable()
Method Detail

getHumanReadableByteSize

public static java.lang.String getHumanReadableByteSize(long size)
Format a byte size like for example "1 kB" or "1.5 MB".

Parameters:
size - The size to be formatted
Returns:
formatted size

getHumanReadableTimeSpan

public static java.lang.String getHumanReadableTimeSpan(long milliseconds)
Format a time span like for example "3h, 4m, 5s, 60ms"

Parameters:
milliseconds -
Returns:
formatted time span


Copyright © -2005 . All Rights Reserved.