Interface DataTypeWithCharset

All Superinterfaces:
DataType
All Known Implementing Classes:
AbstractStringDataType, CharDataType, PascalString255DataType, PascalStringDataType, PascalUnicodeDataType, SignedCharDataType, StringDataType, StringUTF8DataType, TerminatedStringDataType, TerminatedUnicode32DataType, TerminatedUnicodeDataType, Unicode32DataType, UnicodeDataType, UnsignedCharDataType, WideChar16DataType, WideChar32DataType, WideCharDataType

public interface DataTypeWithCharset extends DataType
  • Method Details

    • encodeCharacterValue

      default byte[] encodeCharacterValue(Object value, MemBuffer buf, Settings settings) throws DataTypeEncodeException
      Utility for character data types to encode a value.
      Parameters:
      value - the character value to encode.
      buf - a buffer representing the eventual destination of the bytes.
      settings - the settings to use.
      Returns:
      the encoded value
      Throws:
      DataTypeEncodeException - if the value cannot be encoded
    • encodeCharacterRepresentation

      default byte[] encodeCharacterRepresentation(String repr, MemBuffer buf, Settings settings) throws DataTypeEncodeException
      Utility for character data types to encode a representation.
      Parameters:
      repr - the single-character string to encode.
      buf - a buffer representing the eventual destination of the bytes.
      settings - the settings to use.
      Returns:
      the encoded value
      Throws:
      DataTypeEncodeException - if the value cannot be encoded
    • getCharsetName

      default String getCharsetName(Settings settings)
      Get the character set for a specific data type and settings
      Parameters:
      settings - data instance settings
      Returns:
      Charset for this datatype and settings