# Uses of Class
org.springframework.util.unit.DataSize

Packages that use DataSize
Package
Description
org.springframework.util.unit
Useful unit data types.

## Uses of DataSize in org.springframework.util.unit

Methods in org.springframework.util.unit that return DataSize
Modifier and Type
Method
Description
`static DataSize`
DataSize.`of(long amount, DataUnit unit)`
Obtain a `DataSize` representing an amount in the specified `DataUnit`.
`static DataSize`
DataSize.`ofBytes(long bytes)`
Obtain a `DataSize` representing the specified number of bytes.
`static DataSize`
DataSize.`ofGigabytes(long gigabytes)`
Obtain a `DataSize` representing the specified number of gigabytes.
`static DataSize`
DataSize.`ofKilobytes(long kilobytes)`
Obtain a `DataSize` representing the specified number of kilobytes.
`static DataSize`
DataSize.`ofMegabytes(long megabytes)`
Obtain a `DataSize` representing the specified number of megabytes.
`static DataSize`
DataSize.`ofTerabytes(long terabytes)`
Obtain a `DataSize` representing the specified number of terabytes.
`static DataSize`
DataSize.`parse(CharSequence text)`
Obtain a `DataSize` from a text string such as `"5MB"` using `DataUnit.BYTES` if no unit is specified.
`static DataSize`
DataSize.`parse(CharSequence text, DataUnit defaultUnit)`
Obtain a `DataSize` from a text string such as `"5MB"` using the specified default `DataUnit` if no unit is specified.
Methods in org.springframework.util.unit with parameters of type DataSize
Modifier and Type
Method
Description
`int`
DataSize.`compareTo(DataSize other)`