Class Codec
- java.lang.Object
-
- com.realtime.crossfire.jxclient.util.Codec
-
public class Codec extends java.lang.ObjectUtility class to encode arbitrary Strings to fit in a single text line. For any strings,encode(s)is a string that does not contain \r or \n ands.equals(decode(encode(s)))holds.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull java.lang.Stringdecode(@NotNull java.lang.String str)Decodes a string which was encoded byencode(String).static @NotNull java.lang.Stringencode(@NotNull java.lang.String str)Encodes a string to make it fit into one line.
-
-
-
Method Detail
-
encode
@NotNull public static @NotNull java.lang.String encode(@NotNull @NotNull java.lang.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(String)
-
decode
@NotNull public static @NotNull java.lang.String decode(@NotNull @NotNull java.lang.String str)Decodes a string which was encoded byencode(String).- Parameters:
str- the string to be decoded- Returns:
- the decoded string
- See Also:
encode(String)
-
-