Class Encoder


  • public final class Encoder
    extends Object
    Simple encoding scheme to remove space, linefeed, control characters and anything outside ISO 646.irv:1991 from strings. The scheme is supposed to be human readable and debugging friendly. Opening and closing curly braces are used as quoting characters, the output is by definition US-ASCII only characters.
    Author:
    Steinar Knutsen
    • Constructor Detail

      • Encoder

        public Encoder()
    • Method Detail

      • encode

        public static StringBuilder encode​(String input,
                                           StringBuilder output)
        ISO 646.irv:1991 safe quoting into a StringBuilder instance.
        Parameters:
        input - the string to encode
        output - the destination buffer
        Returns:
        the destination buffer given as input
      • decode

        public static StringBuilder decode​(String input,
                                           StringBuilder output)
        ISO 646.irv:1991 safe unquoting into a StringBuilder instance.
        Parameters:
        input - the string to decode
        output - the destination buffer
        Returns:
        the destination buffer given as input
        Throws:
        IllegalArgumentException - if the input string contains unexpected or invalid data