Class MemorySizes


  • public final class MemorySizes
    extends Object
    • Method Detail

      • parseByteSizeSpecifier

        public static long parseByteSizeSpecifier​(String specifier)
        Parses the given property as a size in bytes. Values are supplied as number strings, supporting an optional size suffix. The common suffixes K, M, and G are supported, having the expected meaning; suffixes are case-insensitive. Omitting the suffix indicates the value is in bytes.
        Parameters:
        propertyName - the name of the property, used for error handling
        specifier - the specifier. for example "100M"
        Returns:
        the size in bytes
        Throws:
        IllegalArgumentException - if the size specifier cannot be parsed or specifies a negative size.