Enum EncodingInfo

java.lang.Object
java.lang.Enum<EncodingInfo>
io.deephaven.base.string.EncodingInfo
All Implemented Interfaces:
LogOutputAppendable, Serializable, Comparable<EncodingInfo>, java.lang.constant.Constable

public enum EncodingInfo
extends Enum<EncodingInfo>
implements LogOutputAppendable
Encoding info enum, to help code determine what assumptions it can make about a CharSet, as well as simplification for encode/decode operations.
  • Enum Constant Details

  • Method Details

    • values

      public static EncodingInfo[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static EncodingInfo valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getEncodingName

      public String 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

      public Charset getCharset()
    • getEncoder

      public CharsetEncoder 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

      public CharsetDecoder 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

      public byte[] encode​(@NotNull String value)
    • decode

      public String decode​(@NotNull byte[] value)
    • decode

      public String decode​(@NotNull byte[] value, int offset, int length)
    • append

      public LogOutput append​(@NotNull LogOutput logOutput)
      Specified by:
      append in interface LogOutputAppendable