public class BytesSizeFormat extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
BYTE |
static int |
DECA
DECA
|
static long |
EiBYTE
exbibyte
|
static long |
EXA
EXA
|
static long |
GiBYTE
TEBI Byte
|
static long |
GIGA
MEGA
|
static int |
HECTO
HECTO
|
static int |
KiBYTE
kibibyte
|
static int |
KILO
KILO
|
static int |
MEGA
MEGA
|
static int |
MiBYTE
mibibyte
|
static long |
PETA
PETA
|
static long |
PiBYTE
PEBI Byte
|
static long |
TERA
TERA
|
static long |
TiBYTE
TEBI Byte
|
static long |
YOTTA
YOTTA
|
static long |
ZETTA
ZETTA
|
| Constructor and Description |
|---|
BytesSizeFormat(boolean leadingZeros,
boolean intermediateZeros,
boolean fixedLength,
boolean binaryPrefix,
long high,
long low,
int depth,
net.thevpc.nuts.NutsSession session) |
BytesSizeFormat(String format,
net.thevpc.nuts.NutsSession session)
Size format is a sequence of commands :
B,K,M,G,T : Show Bytes/Kilo/Mega/Giga/Tera, if this is the first
multiplier it will be considered as the minimum multiplier otherwise it
will be considered as the maximum multiplier
I : binary prefix (use 1024 multipliers)
D : multiplier maximum depth, should be suffixed with an integer (i.e
BTD2 means that if number is in giga will not show further than
kilo)
F : fixed length
Z : if used in the very first position (0) consider leadingZeros, if
at the last position consider trailing zeros if anywhere else consider
intermediateZeros
examples
|
public static final long BYTE
public static final int KiBYTE
public static final int MiBYTE
public static final long GiBYTE
public static final long TiBYTE
public static final long PiBYTE
public static final long EiBYTE
public static final int DECA
public static final int HECTO
public static final int KILO
public static final int MEGA
public static final long GIGA
public static final long TERA
public static final long PETA
public static final long EXA
public static final long ZETTA
public static final long YOTTA
public BytesSizeFormat(boolean leadingZeros,
boolean intermediateZeros,
boolean fixedLength,
boolean binaryPrefix,
long high,
long low,
int depth,
net.thevpc.nuts.NutsSession session)
public BytesSizeFormat(String format, net.thevpc.nuts.NutsSession session)
System.out.println(new MemorySizeFormatter("0I0BEF0").format(1073741824));
0Ei 0Pi 0Ti 1Gi 0Mi 0Ki
System.out.println(new MemorySizeFormatter("00BEF0").format(1073741824));
0E 0P 0T 1G 73M 741K 824B
System.out.println(new MemorySizeFormatter("B0TD1F").format(1073741824));
1G
System.out.println(new MemorySizeFormatter("B0TD2F").format(1073741824));
1G 73M
System.out.println(new MemorySizeFormatter("B0TD3F").format(1073741824));
1G 73M 741K
System.out.println(new MemorySizeFormatter("B0TD1FI").format(1073741824));
1Gi
System.out.println(new MemorySizeFormatter("B0TD2FI").format(1073741824));
1Gi
System.out.println(new MemorySizeFormatter("B0TD3FI").format(1073741824));
1Gi
System.out.println(new MemorySizeFormatter("0I0BEF0").format(1073741824));
0Ei 0Pi 0Ti 1Gi 0Mi 0Ki
System.out.println(new MemorySizeFormatter("I0BEF").format(1073741824));
1Gi
System.out.println(new MemorySizeFormatter("IBEF").format(1073741824));
1Gi
System.out.println(new MemorySizeFormatter("0IBTF").format(1073741824));
0Ti 1Gi
format - size formatsession - sessionCopyright © 2021 vpc open source initiative. All rights reserved.