Package com.yahoo.vespa.http.client.core
Class Encoder
java.lang.Object
com.yahoo.vespa.http.client.core.Encoder
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringBuilder
decode
(String input, StringBuilder output) ISO 646.irv:1991 safe unquoting into a StringBuilder instance.static StringBuilder
encode
(String input, StringBuilder output) ISO 646.irv:1991 safe quoting into a StringBuilder instance.
-
Constructor Details
-
Encoder
public Encoder()
-
-
Method Details
-
encode
ISO 646.irv:1991 safe quoting into a StringBuilder instance.- Parameters:
input
- the string to encodeoutput
- the destination buffer- Returns:
- the destination buffer given as input
-
decode
ISO 646.irv:1991 safe unquoting into a StringBuilder instance.- Parameters:
input
- the string to decodeoutput
- the destination buffer- Returns:
- the destination buffer given as input
- Throws:
IllegalArgumentException
- if the input string contains unexpected or invalid data
-