Package com.google.protobuf
Class TextFormatEscaper
java.lang.Object
com.google.protobuf.TextFormatEscaper
Provide text format escaping support for proto2 instances.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static StringescapeBytes(byte[] input) LikeescapeBytes(ByteString), but used for byte array.(package private) static StringescapeBytes(ByteString input) Escapes bytes in the format used in protocol buffer text format, which is the same as the format used for C string literals.(package private) static StringEscapes bytes in the format used in protocol buffer text format, which is the same as the format used for C string literals.(package private) static StringEscape double quotes and backslashes in a String for unicode output of a message.(package private) static StringescapeText(String input) LikeescapeBytes(ByteString), but escapes a text string.
-
Constructor Details
-
TextFormatEscaper
private TextFormatEscaper()
-
-
Method Details
-
escapeBytes
Escapes bytes in the format used in protocol buffer text format, which is the same as the format used for C string literals. All bytes that are not printable 7-bit ASCII characters are escaped, as well as backslash, single-quote, and double-quote characters. Characters for which no defined short-hand escape sequence is defined will be escaped using 3-digit octal sequences. -
escapeBytes
Escapes bytes in the format used in protocol buffer text format, which is the same as the format used for C string literals. All bytes that are not printable 7-bit ASCII characters are escaped, as well as backslash, single-quote, and double-quote characters. Characters for which no defined short-hand escape sequence is defined will be escaped using 3-digit octal sequences. -
escapeBytes
LikeescapeBytes(ByteString), but used for byte array. -
escapeText
LikeescapeBytes(ByteString), but escapes a text string. Non-ASCII characters are first encoded as UTF-8, then each byte is escaped individually as a 3-digit octal escape. Yes, it's weird. -
escapeDoubleQuotesAndBackslashes
Escape double quotes and backslashes in a String for unicode output of a message.
-