Package com.marcpg.libpg.data.storage
Class BitData
java.lang.Object
com.marcpg.libpg.data.storage.BitData
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
ConstructorDescriptionBitData
(long bits) Create anew BitData
object.BitData
(long data, @NotNull BitData.Unit unit) Create anew BitData
object. -
Method Summary
Modifier and TypeMethodDescriptionlong
getAs
(@NotNull BitData.Unit unit) double
getAsExact
(@NotNull BitData.Unit unit) static @NotNull String
oneUnitFormat
(long b, BitData.Unit.Format format) static @NotNull String
oneUnitFormat
(@NotNull BitData bitData, BitData.Unit.Format format) static @NotNull String
preciselyFormat
(long b, BitData.Unit.Format format) static @NotNull String
preciselyFormat
(@NotNull BitData bitData, BitData.Unit.Format format)
-
Constructor Details
-
BitData
public BitData(long bits) Create anew BitData
object. -
BitData
Create anew BitData
object.
-
-
Method Details
-
getOneUnitFormatted
Get thebit-data
as a formattedstring
that is readable. The formattedbit-data
uses the highestunit
possible for the best readability. -
getPreciselyFormatted
Get thebit-data
as a formattedstring
that is readable. The formattedbit-data
uses the highestunit
possible and then lower ones for remaining time. -
getAs
-
getAsExact
-
oneUnitFormat
-
oneUnitFormat
@NotNull public static @NotNull String oneUnitFormat(@NotNull @NotNull BitData bitData, BitData.Unit.Format format) -
preciselyFormat
-
preciselyFormat
@NotNull public static @NotNull String preciselyFormat(@NotNull @NotNull BitData bitData, BitData.Unit.Format format)
-