Class Encoder

java.lang.Object
org.kink_lang.kink.internal.str.Encoder

public class Encoder extends Object
Converter from texts to a sequence of bytes.
  • Method Details

    • of

      public static Encoder of(CharsetEncoder csEncoder)
      Returns a new encoder for the charset.
      Parameters:
      csEncoder - the charset encoder.
      Returns:
      an encoder.
    • encode

      public byte[] encode(String str)
      Encodes a str.
      Parameters:
      str - a str.
      Returns:
      the encoded bytes.
    • terminate

      public byte[] terminate()
      Terminates the encoder. Calling this method twice is not permitted.
      Returns:
      the last bytes.