Class SizeUtils

java.lang.Object
org.nuxeo.common.utils.SizeUtils

@Deprecated(since="2025.11", forRemoval=true) public class SizeUtils extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
since 2025.11, use ByteSize instead
Class containing helpers related to the expression of sizes in bytes, kilobytes, etc.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final long
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the number of bytes corresponding to a string expressing a size.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • KB

      public static final long KB
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • MB

      public static final long MB
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • GB

      public static final long GB
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • TB

      public static final long TB
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
  • Method Details

    • parseSizeInBytes

      public static long parseSizeInBytes(String string) throws NumberFormatException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the number of bytes corresponding to a string expressing a size.

      The suffixes KB, MB, GB, TB are recognized (in any case).

      Parameters:
      string - the size as a string
      Returns:
      the size
      Throws:
      NumberFormatException - if the size cannot be parsed