Enum Class StringEncoding
- All Implemented Interfaces:
Serializable,Comparable<StringEncoding>,Constable
Types of string encoding.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionZero-terminated US-ASCII string.Zero-terminated big-endian UTF-16 string.Zero-terminated little-endian UTF-16 string.Zero-terminated UTF-16 string.Non-zero-terminated UTF-8 string.Zero-terminated UTF-8 string. -
Method Summary
Modifier and TypeMethodDescriptionintRetrieve the basic character size.Retrieve the Java charset.Retrieve the source literal encoding prefix.booleanDetermine whether strings use a zero terminator.static StringEncodingReturns the enum constant of this class with the specified name.static StringEncoding[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ASCII_ZERO
Zero-terminated US-ASCII string. -
UTF8_ZERO
Zero-terminated UTF-8 string. -
UTF16_LE_ZERO
Zero-terminated little-endian UTF-16 string. -
UTF16_BE_ZERO
Zero-terminated big-endian UTF-16 string. -
UTF16_ZERO
Zero-terminated UTF-16 string. -
UTF8_NONZERO
Non-zero-terminated UTF-8 string.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getBasicCharSize
public int getBasicCharSize()Retrieve the basic character size.- Returns:
- character size in bytes
-
getCharset
Retrieve the Java charset.- Returns:
- charset
-
isZeroTerminated
public boolean isZeroTerminated()Determine whether strings use a zero terminator.- Returns:
- true for zero-terminated strings
-
getEncodingPrefix
Retrieve the source literal encoding prefix.- Returns:
- encoding prefix, possibly empty
-