Skip to content

Commit f485f6a

Browse files
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

6 files changed

+1693
-0
lines changed

docs/release-notes.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ <h3>Version 6.0.11</h3>
3838
<br><br>
3939
</li>
4040

41+
<li>
42+
Added new BinarySizeUnit and DecimalSizeUnit enums that can be used when working
43+
with data sizes in a variety of units, including bytes, kilobytes, megabytes,
44+
gigabytes, terabytes, petabytes, exabytes, zettabytes, and yottabytes. These
45+
enums provide methods for determining the number of bytes in a specified number
46+
of instances of the given unit, determining the number of instances of a unit
47+
represented by a given number of bytes, and generating a human-readable string
48+
representation of a given number of bytes using the unit deemed most appropriate.
49+
The BinarySizeUnit enum assumes that each unit is 1024 times larger than the next
50+
smaller unit (e.g., so one kilobyte is 1024 bytes, one megabyte is 1024
51+
kilobytes, etc.), while the DecimalSizeUnit enum assumes that each unit is 1000
52+
times larger than the next smaller unit (e.g., so one kilobyte is 1000 bytes, one
53+
megabyte is 1000 kilobytes, etc.).
54+
<br><br>
55+
</li>
56+
4157
<li>
4258
Updated client-side support for the LDIF export administrative task in the Ping
4359
Identity Directory Server to allow requesting that the server invoke one or more

messages/unboundid-ldapsdk-util.properties

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,3 +1253,30 @@ ERR_GET_NON_FIPS_BC_CLASS_LOADER_NO_JARS_FOUND=Unable to create a class \
12531253
ERR_PROXY_SF_CANNOT_CREATE_UNCONNECTED_SOCKET=Unable to create an unconnected \
12541254
socket for communication through a proxy server when an SSLSocketFactory \
12551255
has been configured.
1256+
INFO_SIZE_UNIT_BYTES_SINGULAR=byte
1257+
INFO_SIZE_UNIT_BYTES_PLURAL=bytes
1258+
INFO_SIZE_UNIT_BYTES_ABBREVIATION=B
1259+
INFO_SIZE_UNIT_KILOBYTES_SINGULAR=kilobyte
1260+
INFO_SIZE_UNIT_KILOBYTES_PLURAL=kilobytes
1261+
INFO_SIZE_UNIT_KILOBYTES_ABBREVIATION=KB
1262+
INFO_SIZE_UNIT_MEGABYTES_SINGULAR=megabyte
1263+
INFO_SIZE_UNIT_MEGABYTES_PLURAL=megabytes
1264+
INFO_SIZE_UNIT_MEGABYTES_ABBREVIATION=MB
1265+
INFO_SIZE_UNIT_GIGABYTES_SINGULAR=gigabyte
1266+
INFO_SIZE_UNIT_GIGABYTES_PLURAL=gigabytes
1267+
INFO_SIZE_UNIT_GIGABYTES_ABBREVIATION=GB
1268+
INFO_SIZE_UNIT_TERABYTES_SINGULAR=terabyte
1269+
INFO_SIZE_UNIT_TERABYTES_PLURAL=terabytes
1270+
INFO_SIZE_UNIT_TERABYTES_ABBREVIATION=TB
1271+
INFO_SIZE_UNIT_PETABYTES_SINGULAR=petabyte
1272+
INFO_SIZE_UNIT_PETABYTES_PLURAL=petabytes
1273+
INFO_SIZE_UNIT_PETABYTES_ABBREVIATION=PB
1274+
INFO_SIZE_UNIT_EXABYTES_SINGULAR=exabyte
1275+
INFO_SIZE_UNIT_EXABYTES_PLURAL=exabytes
1276+
INFO_SIZE_UNIT_EXABYTES_ABBREVIATION=EB
1277+
INFO_SIZE_UNIT_ZETTABYTES_SINGULAR=zettabyte
1278+
INFO_SIZE_UNIT_ZETTABYTES_PLURAL=zettabytes
1279+
INFO_SIZE_UNIT_ZETTABYTES_ABBREVIATION=ZB
1280+
INFO_SIZE_UNIT_YOTTABYTES_SINGULAR=yottabyte
1281+
INFO_SIZE_UNIT_YOTTABYTES_PLURAL=yottabytes
1282+
INFO_SIZE_UNIT_YOTTABYTES_ABBREVIATION=YB

0 commit comments

Comments
 (0)