Package com.marcpg.libpg.data.storage
Class ByteData
java.lang.Object
com.marcpg.libpg.data.storage.ByteData
ByteData is used to convert and store data.
Sources:
- IBM - Units of Measurement for Storage Data
- Wikipedia - Units of information
- WebPerfect - Data Units
Sources:
- IBM - Units of Measurement for Storage Data
- Wikipedia - Units of information
- WebPerfect - Data Units
- Since:
- 0.0.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
-
Constructor Summary
ConstructorDescriptionByteData
(long bytes) Create anew ByteData
object.ByteData
(long data, @NotNull ByteData.Unit unit) Create anew ByteData
object. -
Method Summary
Modifier and TypeMethodDescriptionlong
getAs
(@NotNull ByteData.Unit unit) double
getAsExact
(@NotNull ByteData.Unit unit) static @NotNull String
oneUnitFormat
(long b, ByteData.Unit.Format format) static @NotNull String
oneUnitFormat
(@NotNull ByteData byteData, ByteData.Unit.Format format) static @NotNull String
preciselyFormat
(long b, ByteData.Unit.Format format) static @NotNull String
preciselyFormat
(@NotNull ByteData byteData, ByteData.Unit.Format format)
-
Constructor Details
-
ByteData
public ByteData(long bytes) Create anew ByteData
object. -
ByteData
Create anew ByteData
object.
-
-
Method Details
-
getOneUnitFormatted
Get thebyte-data
as a formattedstring
that is readable. The formattedbyte-data
uses the highestunit
possible for the best readability. -
getPreciselyFormatted
Get thebyte-data
as a formattedstring
that is readable. The formattedbyte-data
uses the highestunit
possible and then lower ones for remaining time. -
getAs
-
getAsExact
-
oneUnitFormat
-
oneUnitFormat
@NotNull public static @NotNull String oneUnitFormat(@NotNull @NotNull ByteData byteData, ByteData.Unit.Format format) -
preciselyFormat
-
preciselyFormat
@NotNull public static @NotNull String preciselyFormat(@NotNull @NotNull ByteData byteData, ByteData.Unit.Format format)
-