RFR: 8362637: Convert java.nio.ByteOrder to an enum

Alan Bateman alanb at openjdk.org
Tue Oct 7 10:37:47 UTC 2025


On Mon, 6 Oct 2025 22:10:51 GMT, Chen Liang <liach at openjdk.org> wrote:

> Why do we reorder the BIG_ENDIAN and LITTLE_ENDIAN fields?

enums are Comparable and giving LITTLE_ENDIAN the 0 ordinal means it is less than BIG_ENDIAN. I don't think byte orders will be compared too often but it does avoid a surprise.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27657#issuecomment-3376291701


More information about the nio-dev mailing list