toAsciiOrNull

Encodes a Char to a Byte in ASCII or null if the character cannot be represented in ASCII.

Return

the ByteArray representing the Char in ASCII if it can be represented in ASCII, null otherwise.


Encodes a String to a ByteArray using ASCII or null if the string contains a non-ASCII character.

Return

the ByteArray representing the String in ASCII if it can be represented in ASCII, null otherwise.

Parameters

byteOrder

the ByteOrder to use.