Commit f485f6a
committed
Add size unit enums
Added new BinarySizeUnit and DecimalSizeUnit enums that can be used
when working with data sizes in a variety of units, including bytes,
kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes,
zettabytes, and yottabytes. These enums provide methods for
determining the number of bytes in a specified number of instances
of the given unit, determining the number of instances of a unit
represented by a given number of bytes, and generating a
human-readable string representation of a given number of bytes
using the unit deemed most appropriate. The BinarySizeUnit enum
assumes that each unit is 1024 times larger than the next smaller
unit (e.g., so one kilobyte is 1024 bytes, one megabyte is 1024
kilobytes, etc.), while the DecimalSizeUnit enum assumes that each
unit is 1000 times larger than the next smaller unit (e.g., so one
kilobyte is 1000 bytes, one megabyte is 1000 kilobytes, etc.).1 parent 3dad7ef commit f485f6a
File tree
6 files changed
+1693
-0
lines changed- docs
- messages
- src/com/unboundid/util
- tests/unit/src/com/unboundid/util
6 files changed
+1693
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
41 | 57 | | |
42 | 58 | | |
43 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1253 | 1253 | | |
1254 | 1254 | | |
1255 | 1255 | | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
0 commit comments