Class ByteSize

java.lang.Object
ecmwf.common.technical.ByteSize

public class ByteSize extends Object
ECMWF Product Data Store (OpenECPDS) Project.
Since:
2024-07-01
Version:
6.7.7
Author:
Laurent Gougeon - syi@ecmwf.int, ECMWF.
  • Field Details

  • Method Details

    • ofKB

      public static ByteSize ofKB(long bytes)
      Of KB.
      Parameters:
      bytes - the bytes
      Returns:
      the byte size
    • ofMB

      public static ByteSize ofMB(long bytes)
      Of MB.
      Parameters:
      bytes - the bytes
      Returns:
      the byte size
    • ofGB

      public static ByteSize ofGB(long bytes)
      Of GB.
      Parameters:
      bytes - the bytes
      Returns:
      the byte size
    • ofTB

      public static ByteSize ofTB(long bytes)
      Of TB.
      Parameters:
      bytes - the bytes
      Returns:
      the byte size
    • ofPB

      public static ByteSize ofPB(long bytes)
      Of PB.
      Parameters:
      bytes - the bytes
      Returns:
      the byte size
    • ofEB

      public static ByteSize ofEB(long bytes)
      Of EB.
      Parameters:
      bytes - the bytes
      Returns:
      the byte size
    • size

      public long size()
      Size.
      Returns:
      the long
    • bits

      public long bits()
      Bits.
      Returns:
      the long
    • of

      public static ByteSize of(long bytesCount)
      Of.
      Parameters:
      bytesCount - the bytes count
      Returns:
      the byte size
    • parse

      public static ByteSize parse(String bytesCount)
      Parses the.
      Parameters:
      bytesCount - the bytes count
      Returns:
      the byte size
    • isZero

      public boolean isZero()
      Checks if is zero.
      Returns:
      true, if is zero
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object