Skip to content

Commit

Permalink
Add size unit enums
Browse files Browse the repository at this point in the history
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.).
  • Loading branch information
dirmgr committed Nov 8, 2023
1 parent 3dad7ef commit f485f6a
Show file tree
Hide file tree
Showing 6 changed files with 1,693 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ <h3>Version 6.0.11</h3>
<br><br>
</li>

<li>
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.).
<br><br>
</li>

<li>
Updated client-side support for the LDIF export administrative task in the Ping
Identity Directory Server to allow requesting that the server invoke one or more
Expand Down
27 changes: 27 additions & 0 deletions messages/unboundid-ldapsdk-util.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1253,3 +1253,30 @@ ERR_GET_NON_FIPS_BC_CLASS_LOADER_NO_JARS_FOUND=Unable to create a class \
ERR_PROXY_SF_CANNOT_CREATE_UNCONNECTED_SOCKET=Unable to create an unconnected \
socket for communication through a proxy server when an SSLSocketFactory \
has been configured.
INFO_SIZE_UNIT_BYTES_SINGULAR=byte
INFO_SIZE_UNIT_BYTES_PLURAL=bytes
INFO_SIZE_UNIT_BYTES_ABBREVIATION=B
INFO_SIZE_UNIT_KILOBYTES_SINGULAR=kilobyte
INFO_SIZE_UNIT_KILOBYTES_PLURAL=kilobytes
INFO_SIZE_UNIT_KILOBYTES_ABBREVIATION=KB
INFO_SIZE_UNIT_MEGABYTES_SINGULAR=megabyte
INFO_SIZE_UNIT_MEGABYTES_PLURAL=megabytes
INFO_SIZE_UNIT_MEGABYTES_ABBREVIATION=MB
INFO_SIZE_UNIT_GIGABYTES_SINGULAR=gigabyte
INFO_SIZE_UNIT_GIGABYTES_PLURAL=gigabytes
INFO_SIZE_UNIT_GIGABYTES_ABBREVIATION=GB
INFO_SIZE_UNIT_TERABYTES_SINGULAR=terabyte
INFO_SIZE_UNIT_TERABYTES_PLURAL=terabytes
INFO_SIZE_UNIT_TERABYTES_ABBREVIATION=TB
INFO_SIZE_UNIT_PETABYTES_SINGULAR=petabyte
INFO_SIZE_UNIT_PETABYTES_PLURAL=petabytes
INFO_SIZE_UNIT_PETABYTES_ABBREVIATION=PB
INFO_SIZE_UNIT_EXABYTES_SINGULAR=exabyte
INFO_SIZE_UNIT_EXABYTES_PLURAL=exabytes
INFO_SIZE_UNIT_EXABYTES_ABBREVIATION=EB
INFO_SIZE_UNIT_ZETTABYTES_SINGULAR=zettabyte
INFO_SIZE_UNIT_ZETTABYTES_PLURAL=zettabytes
INFO_SIZE_UNIT_ZETTABYTES_ABBREVIATION=ZB
INFO_SIZE_UNIT_YOTTABYTES_SINGULAR=yottabyte
INFO_SIZE_UNIT_YOTTABYTES_PLURAL=yottabytes
INFO_SIZE_UNIT_YOTTABYTES_ABBREVIATION=YB
Loading

0 comments on commit f485f6a

Please sign in to comment.