java.lang.Object
com.realtime.crossfire.jxclient.util.Codec

public class Codec extends Object
Utility class to encode arbitrary Strings to fit in a single text line. For any string s, encode(s) is a string that does not contain \r or \n and s.equals(decode(encode(s))) holds.
  • Method Details

    • encode

      @NotNull public static @NotNull String encode(@NotNull @NotNull String str)
      Encodes a string to make it fit into one line.
      Parameters:
      str - the string to be encoded
      Returns:
      the encoded string
      See Also:
    • decode

      @NotNull public static @NotNull String decode(@NotNull @NotNull String str)
      Decodes a string which was encoded by encode(String).
      Parameters:
      str - the string to be decoded
      Returns:
      the decoded string
      See Also: