public class SizeUtil extends Object
Constructor and Description |
---|
SizeUtil() |
Modifier and Type | Method and Description |
---|---|
static Size |
getSize(long size,
SizeUnit unit)
|
static Size |
getSize(long size,
SizeUnit unit,
SizeUnitType type)
get file size
|
static String |
toMinimumByte(long bytes,
SizeUnitType type)
change byte to minimum size
From: stackoverflow |
public static String toMinimumByte(long bytes, SizeUnitType type)
Beware: this method call support until SizeUnit.EB
only because of Long.MAX_VALUE
bytes
- number of bytestype
- type of unitpublic static Size getSize(long size, SizeUnit unit, SizeUnitType type)
size
- file sizeunit
- the size unittype
- the type of unitSize
NullPointerException
- if one of parameter will nullSizeUnit
,
SizeUnitType
,
Size
Copyright © 2017. All rights reserved.