|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jets3t.service.utils.ByteFormatter
public class ByteFormatter
Formats numeric byte values into human-readable strings.
| Constructor Summary | |
|---|---|
ByteFormatter()
Constructs a formatter that will use default text to represent byte amounts. |
|
ByteFormatter(String gigabyteSuffix,
String megabyteSuffix,
String kilobyteSuffix,
String byteSuffix,
int decimalPlaces)
Constructs a formatter that will use the given values when formatting byte values. |
|
| Method Summary | |
|---|---|
String |
formatByteSize(long byteSize)
Converts a byte size into a human-readable string, such as "1.43 MB" or "27 KB". |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteFormatter()
public ByteFormatter(String gigabyteSuffix,
String megabyteSuffix,
String kilobyteSuffix,
String byteSuffix,
int decimalPlaces)
gigabyteSuffix - string to display at the end of gigabyte values.megabyteSuffix - string to display at the end of megabyte values.kilobyteSuffix - string to display at the end of kilobyte values.byteSuffix - string to display at the end of byte values.decimalPlaces - the number of decimal places to use when converting byte amounts into kilo, mega or giga
byte values.| Method Detail |
|---|
public String formatByteSize(long byteSize)
byteSize - the byte size of some item
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||