public class Size extends Object
The size of data.
Constructor and Description |
---|
Size()
Creates a size of 0 bytes.
|
Size(long size)
Creates a size in bytes.
|
Modifier and Type | Method and Description |
---|---|
long |
getBytes()
Returns the size in bytes.
|
long |
getKiloBytes()
Returns the size in kilobytes.
|
static Size |
getSizeInBytes(long size)
Returns the size for the specified number of bytes.
|
static Size |
getSizeInKiloBytes(long size)
Returns the size for the specified number of kilobytes.
|
public Size()
Creates a size of 0 bytes.
public Size(long size)
Creates a size in bytes.
size
- The size in bytes.public long getBytes()
Returns the size in bytes.
public long getKiloBytes()
Returns the size in kilobytes.
The size is divided by 1024 and rounded up.
public static Size getSizeInBytes(long size)
Returns the size for the specified number of bytes.
size
- The size in bytes.public static Size getSizeInKiloBytes(long size)
Returns the size for the specified number of kilobytes.
size
- The size in kilobytes.Copyright © 2015–2019. All rights reserved.