Package ch.qos.logback.core.util

## Class FileSize

- java.lang.Object
- - ch.qos.logback.core.util.FileSize

    public class FileSize
    extends java.lang.Object

Instances of this class represent the size of a file. Internally, the size is stored as long.>

The `valueOf(java.lang.String)` method can convert strings such as "3 kb", "5 mb", into FileSize instances. The recognized unit specifications for file size are the "kb", "mb", and "gb". The unit name may be followed by an "s". Thus, "2 kbs" and "2 kb" are equivalent. In the absence of a time unit specification, byte is assumed.

Author:
  Ceki Gülcü

### Field Summary

Fields
`static long` `GB_COEFFICIENT`
`static long` `KB_COEFFICIENT`
`static long` `MB_COEFFICIENT`

### Constructor Summary

Constructors
`FileSize​(long size)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`long` `getSize()`
`java.lang.String` `toString()`
`static FileSize` `valueOf​(java.lang.String fileSizeStr)`

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

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

### Field Detail

#### KB_COEFFICIENT

    public static final long KB_COEFFICIENT

See Also:
  Constant Field Values

#### MB_COEFFICIENT

    public static final long MB_COEFFICIENT

See Also:
  Constant Field Values

#### GB_COEFFICIENT

    public static final long GB_COEFFICIENT

See Also:
  Constant Field Values

### Constructor Detail

#### FileSize

    public FileSize​(long size)

### Method Detail

#### getSize

    public long getSize()

#### valueOf

    public static FileSize valueOf​(java.lang.String fileSizeStr)

#### toString

    public java.lang.String toString()

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