aboutsummaryrefslogtreecommitdiffhomepage
path: root/java/core/src/main/java/com/google/protobuf/Parser.java
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-29 14:32:48 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-29 14:33:05 -0700
commitd36c0c538a545fac5d9db6ba65c525246d4efa95 (patch)
tree3fd29af0f137dfaf5df892723e60600f674392b3 /java/core/src/main/java/com/google/protobuf/Parser.java
parent4a0dd03e52e09332c8fd0f8f26a8e0ae9f911182 (diff)
Down-integrate from google3.
Diffstat (limited to 'java/core/src/main/java/com/google/protobuf/Parser.java')
-rw-r--r--java/core/src/main/java/com/google/protobuf/Parser.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/java/core/src/main/java/com/google/protobuf/Parser.java b/java/core/src/main/java/com/google/protobuf/Parser.java
index cfbcb442..e07c6895 100644
--- a/java/core/src/main/java/com/google/protobuf/Parser.java
+++ b/java/core/src/main/java/com/google/protobuf/Parser.java
@@ -31,6 +31,7 @@
package com.google.protobuf;
import java.io.InputStream;
+import java.nio.ByteBuffer;
/**
* Abstract interface for parsing Protocol Messages.
@@ -93,6 +94,18 @@ public interface Parser<MessageType> {
// Convenience methods.
/**
+ * Parses {@code data} as a message of {@code MessageType}. This is just a small wrapper around
+ * {@link #parseFrom(CodedInputStream)}.
+ */
+ public MessageType parseFrom(ByteBuffer data) throws InvalidProtocolBufferException;
+
+ /**
+ * Parses {@code data} as a message of {@code MessageType}. This is just a small wrapper around
+ * {@link #parseFrom(CodedInputStream, ExtensionRegistryLite)}.
+ */
+ public MessageType parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
+ throws InvalidProtocolBufferException;
+ /**
* Parses {@code data} as a message of {@code MessageType}.
* This is just a small wrapper around {@link #parseFrom(CodedInputStream)}.
*/