Class ByteContentSize

java.lang.Object
org.midheaven.io.ByteContentSize

public final class ByteContentSize extends Object
  • Field Details

  • Method Details

    • fromBytes

      public static ByteContentSize fromBytes(long size)
      Returns from Bytes.
      Parameters:
      size - the size value
      Returns:
      the result of fromBytes
    • of

      public static ByteContentSize of(Rational size, ByteContentSizeUnit unit)
      Creates an instance from the provided value.
      Parameters:
      size - the size value
      unit - the unit value
      Returns:
      the result of of
    • of

      public static ByteContentSize of(long size, ByteContentSizeUnit unit)
      Creates an instance from the provided value.
      Parameters:
      size - the size value
      unit - the unit value
      Returns:
      the result of of
    • inBytes

      public long inBytes()
      Performs inBytes.
      Returns:
      the result of inBytes
    • in

      public Rational in(ByteContentSizeUnit targetUnit)
      Performs in.
      Parameters:
      targetUnit - the targetUnit value
      Returns:
      the result of in
    • equals

      public boolean equals(Object other)
      Performs equals.
      Overrides:
      equals in class Object
      Parameters:
      other - the other value
      Returns:
      the result of equals
    • hashCode

      public int hashCode()
      Checks whether hash Code.
      Overrides:
      hashCode in class Object
      Returns:
      the result of hashCode