Interface CharEncoder

All Known Implementing Classes:
CharsetCharEncoder, TableCharEncoder

public interface CharEncoder
A char encoder that encodes chars to a suite of bytes. No assumptions must be made about the statefullness nature of an encoder as some encoder may be statefull and some encoder may be stateless.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    encode(char c)
    Encodes a single char into an array of bytes.
    Returns the charset that will perform the encoding.
  • Method Details

    • encode

      byte[] encode(char c)
      Encodes a single char into an array of bytes. The returned array of bytes should not be modified.
      Parameters:
      c - the char to encode
      Returns:
      the serie of bytes corresponding to the encoded char
    • getCharset

      Charset getCharset()
      Returns the charset that will perform the encoding.
      Returns:
      the charset for encoding