Enum MemoryUnit

    • Method Detail

      • values

        public static MemoryUnit[] 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 (MemoryUnit c : MemoryUnit.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MemoryUnit valueOf​(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
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getSuffix

        public String getSuffix()
      • convert

        public long convert​(long sourceSize,
                            MemoryUnit sourceUnit)
      • toBytes

        public long toBytes​(long size)
      • toKiloBytes

        public long toKiloBytes​(long size)
      • toKibiBytes

        public long toKibiBytes​(long size)
      • toMegaBytes

        public long toMegaBytes​(long size)
      • toMebiBytes

        public long toMebiBytes​(long size)
      • toGigaBytes

        public long toGigaBytes​(long size)
      • toGibiBytes

        public long toGibiBytes​(long size)
      • toTeraBytes

        public long toTeraBytes​(long size)
      • toTebiBytes

        public long toTebiBytes​(long size)
      • parseBytes

        public static long parseBytes​(String s)