public final class FormatUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
byteBufferToString(ByteBuffer buf)
Parses a
ByteBuffer into a String. |
static String |
formatTimeTakenMs(long startTimeMs,
String message)
Formats time elapsed since the given start time (in milliseconds).
|
static String |
formatTimeTakenNs(long startTimeNs,
String message)
Formats time elapsed since the given start time (in nanoseconds).
|
static String |
getSizeFromBytes(long bytes)
Returns a human-readable version of bytes 10GB 2048KB etc.
|
static String |
parametersToString(Object... objs)
Parses a list of
Objects into a String. |
static long |
parseSpaceSize(String spaceSize)
Parses a String size to Bytes.
|
public static String parametersToString(Object... objs)
Objects into a String.objs - a list of Objects to convert to a Stringpublic static String byteBufferToString(ByteBuffer buf)
ByteBuffer into a String. In particular, the function prints
the content of the buffer in 4-byte increments as space separated integers.buf - buffer to usepublic static String formatTimeTakenMs(long startTimeMs, String message)
startTimeMs - start time in millisecondsmessage - prefix for the message to be printedpublic static String formatTimeTakenNs(long startTimeNs, String message)
startTimeNs - start time in nanosecondsmessage - prefix for the message to be printedpublic static String getSizeFromBytes(long bytes)
bytes - the number of bytespublic static long parseSpaceSize(String spaceSize)
spaceSize - the size of a space, e.g. 10GB, 5TB, 1024Copyright © 2015. All Rights Reserved.