RFR: 8251989: Hex formatting and parsing utility
Douglas Surber
douglas.surber at oracle.com
Fri Oct 2 16:16:42 UTC 2020
This looks good overall. I would change the names of withPrefix and withSuffix to withBytePrefix and withByteSuffix and add some words to their JavaDoc clarifying that they apply to the individual bytes.
Douglas
> On Oct 2, 2020, at 8:53 AM, core-libs-dev-request at openjdk.java.net wrote:
>
> Date: Fri, 2 Oct 2020 15:53:39 GMT
> From: Roger Riggs <rriggs at openjdk.java.net <mailto:rriggs at openjdk.java.net>>
> To: <core-libs-dev at openjdk.java.net <mailto:core-libs-dev at openjdk.java.net>>
> Subject: Re: RFR: 8251989: Hex formatting and parsing utility
> Message-ID:
> <X-O2yD1-1el59xpXjEPhSNWFJAWLhT5lrsa1Bs8gGLw=.7f5b1392-8146-4cbf-b598-a46595f6c241 at github.com <mailto:X-O2yD1-1el59xpXjEPhSNWFJAWLhT5lrsa1Bs8gGLw=.7f5b1392-8146-4cbf-b598-a46595f6c241 at github.com>>
>
> Content-Type: text/plain; charset=utf-8
>
> On Fri, 2 Oct 2020 15:18:04 GMT, Roger Riggs <rriggs at openjdk.org <mailto:rriggs at openjdk.org>> wrote:
>
>> java.util.HexFormat utility:
>>
>> - Format and parse hexadecimal strings, with parameters for delimiter, prefix, suffix and upper/lowercase
>> - Static factories and builder methods to create HexFormat copies with modified parameters.
>> - Consistent naming of methods for conversion of byte arrays to formatted strings and back: formatHex and parseHex
>> - Consistent naming of methods for conversion of primitive types: toHexDigits... and fromHexDigits...
>> - Prefix and suffixes now apply to each formatted value, not the string as a whole
>> - Using java.util.Appendable as a target for buffered conversions so output to Writers and PrintStreams
>> like System.out are supported in addition to StringBuilder. (IOExceptions are converted to unchecked exceptions)
>> - Immutable and thread safe, a "value-based" class
>>
>> See the [HexFormat
>> javadoc](http://cr.openjdk.java.net/~rriggs/8251989-hex-formatter/java.base/java/util/HexFormat.html <http://cr.openjdk.java.net/~rriggs/8251989-hex-formatter/java.base/java/util/HexFormat.html>) for details.
>> Review comments and suggestions welcome.
>
> To avoid spamming email lists, I'm removing the i18n, net, nio, and security labels since most developers already are
> subscribed to core-libs. Please re-add a label if you think it is useful to the email list.
>
> -------------
>
> PR: https://git.openjdk.java.net/jdk/pull/482 <https://git.openjdk.java.net/jdk/pull/482>
>
More information about the core-libs-dev
mailing list