Package io.deephaven.base.string
Enum Class EncodingInfo
- All Implemented Interfaces:
LogOutputAppendable
,Serializable
,Comparable<EncodingInfo>
,java.lang.constant.Constable
Encoding info enum, to help code determine what assumptions it can make about a CharSet, as well as simplification
for encode/decode operations.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecode
(@org.jetbrains.annotations.NotNull byte[] value) decode
(@org.jetbrains.annotations.NotNull byte[] value, int offset, int length) byte[]
Get a thread local decoder for this encoding info.Get a thread local encoder for this encoding info.boolean
isSimple()
Can this encoding info's charset be encoded or decoded by simple linear assignment of char->byte or byte->char.static EncodingInfo
Returns the enum constant of this class with the specified name.static EncodingInfo[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
US_ASCII
-
ISO_8859_1
-
UTF_8
-
UTF_16BE
-
UTF_16LE
-
UTF_16
-
-
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
-
getEncodingName
-
isSimple
public boolean isSimple()Can this encoding info's charset be encoded or decoded by simple linear assignment of char->byte or byte->char.- Returns:
- Whether this encoding info's charset is simple
-
getCharset
-
getEncoder
Get a thread local encoder for this encoding info.
The encoder will be setup to replace malformed input or unmappable characters, and these settings should be restored if changed.
- Returns:
- A thread local encoder for this encoding info
-
getDecoder
Get a thread local decoder for this encoding info.
The decoder will be setup to replace malformed input or unmappable characters, and these settings should be restored if changed.
- Returns:
- A thread local decoder for this encoding info
-
encode
-
decode
-
decode
public String decode(@NotNull @org.jetbrains.annotations.NotNull byte[] value, int offset, int length) -
append
- Specified by:
append
in interfaceLogOutputAppendable
-