Enum ByteSizeUnit

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ByteSizeUnit>, Writeable

    public enum ByteSizeUnit
    extends java.lang.Enum<ByteSizeUnit>
    implements Writeable
    A SizeUnit represents size at a given unit of granularity and provides utility methods to convert across units. A SizeUnit does not maintain size information, but only helps organize and use size representations that may be maintained separately across various contexts.
    • Method Detail

      • values

        public static ByteSizeUnit[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ByteSizeUnit c : ByteSizeUnit.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ByteSizeUnit valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • toBytes

        public abstract long toBytes​(long size)
      • toKB

        public abstract long toKB​(long size)
      • toMB

        public abstract long toMB​(long size)
      • toGB

        public abstract long toGB​(long size)
      • toTB

        public abstract long toTB​(long size)
      • toPB

        public abstract long toPB​(long size)
      • getSuffix

        public abstract java.lang.String getSuffix()