diff options
author | jieluo@google.com <jieluo@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2014-07-18 17:44:42 +0000 |
---|---|---|
committer | jieluo@google.com <jieluo@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2014-07-18 17:44:42 +0000 |
commit | 01283faa4707f0224d4726893c6581ac2407a30d (patch) | |
tree | 84e968aa1a9553dd08217b048d8f371eb7fcd597 | |
parent | 4de8f55113007fdc8e34107950e605fc0209d465 (diff) | |
download | protobuf-01283faa4707f0224d4726893c6581ac2407a30d.tar.gz protobuf-01283faa4707f0224d4726893c6581ac2407a30d.tar.bz2 protobuf-01283faa4707f0224d4726893c6581ac2407a30d.zip |
add printUnicode methods in TextFormat
-rw-r--r-- | java/src/main/java/com/google/protobuf/TextFormat.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/java/src/main/java/com/google/protobuf/TextFormat.java b/java/src/main/java/com/google/protobuf/TextFormat.java index 97da09bb..c619ba65 100644 --- a/java/src/main/java/com/google/protobuf/TextFormat.java +++ b/java/src/main/java/com/google/protobuf/TextFormat.java @@ -84,6 +84,26 @@ public final class TextFormat { } /** + * Same as {@code print()}, except that non-ASCII characters are not + * escaped. + */ + public static void printUnicode( + final MessageOrBuilder message, final Appendable output) + throws IOException { + UNICODE_PRINTER.print(message, new TextGenerator(output)); + } + + /** + * Same as {@code print()}, except that non-ASCII characters are not + * escaped. + */ + public static void printUnicode(final UnknownFieldSet fields, + final Appendable output) + throws IOException { + UNICODE_PRINTER.printUnknownFields(fields, new TextGenerator(output)); + } + + /** * Generates a human readable form of this message, useful for debugging and * other purposes, with no newline characters. */ |