com.typesafe.config

## Class ConfigMemorySize

- java.lang.Object
- - com.typesafe.config.ConfigMemorySize

    public final class ConfigMemorySize
    extends java.lang.Object

An immutable class representing an amount of memory. Use static factory methods such as `ofBytes(BigInteger)` to create instances.

Since:
  1.3.0

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `equals(java.lang.Object other)`
`int` `hashCode()`
`static ConfigMemorySize` `ofBytes(java.math.BigInteger bytes)` Constructs a ConfigMemorySize representing the given number of bytes.
`static ConfigMemorySize` `ofBytes(long bytes)` Constructs a ConfigMemorySize representing the given number of bytes.
`long` `toBytes()` Gets the size in bytes.
`java.math.BigInteger` `toBytesBigInteger()` Gets the size in bytes.
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Method Detail

#### ofBytes

    public static ofBytes(java.math.BigInteger bytes)

Constructs a ConfigMemorySize representing the given number of bytes.

Parameters:
  `bytes` - a number of bytes
Returns:
  an instance representing the number of bytes
Since:
  1.3.0

#### ofBytes

    public static ofBytes(long bytes)

Constructs a ConfigMemorySize representing the given number of bytes.

Parameters:
  `bytes` - a number of bytes
Returns:
  an instance representing the number of bytes

#### toBytes

    public long toBytes()

Gets the size in bytes.

Returns:
  how many bytes
Throws:
  `java.lang.IllegalArgumentException` - when memory value in bytes doesn't fit in a long value. Consider using `toBytesBigInteger()` in this case.
Since:
  1.3.0

#### toBytesBigInteger

    public java.math.BigInteger toBytesBigInteger()

Gets the size in bytes. The behavior of this method is the same as that of the `toBytes()` method, except that the number of bytes returned as a BigInteger value. Use it when memory value in bytes doesn't fit in a long value.

Returns:
  how many bytes

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### equals

    public boolean equals(java.lang.Object other)

Overrides:
  `equals` in class `java.lang.Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`