aboutsummaryrefslogtreecommitdiff
path: root/protobuf-nano
diff options
context:
space:
mode:
authorLouis Ryan <lryan@google.com>2015-05-22 10:25:16 -0700
committerLouis Ryan <lryan@google.com>2015-05-26 15:44:46 -0700
commit641fc288fc230862a00f2087f7f12030e83b1584 (patch)
tree25584f8ac2d8c7ed38fbff5a84b2949297d22c90 /protobuf-nano
parentb0619c4c38ed524b08b495b0099e74617d0a2a00 (diff)
downloadgrpc-grpc-java-641fc288fc230862a00f2087f7f12030e83b1584.tar.gz
Add support for indeterminate length messages. This will make using GRPC easier for non-proto payload types.
Sync to head
Diffstat (limited to 'protobuf-nano')
-rw-r--r--protobuf-nano/src/main/java/io/grpc/protobuf/nano/DeferredNanoProtoInputStream.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/protobuf-nano/src/main/java/io/grpc/protobuf/nano/DeferredNanoProtoInputStream.java b/protobuf-nano/src/main/java/io/grpc/protobuf/nano/DeferredNanoProtoInputStream.java
index f0aa1af2e..8fed0fe58 100644
--- a/protobuf-nano/src/main/java/io/grpc/protobuf/nano/DeferredNanoProtoInputStream.java
+++ b/protobuf-nano/src/main/java/io/grpc/protobuf/nano/DeferredNanoProtoInputStream.java
@@ -36,6 +36,7 @@ import com.google.protobuf.nano.CodedOutputByteBufferNano;
import com.google.protobuf.nano.MessageNano;
import io.grpc.DeferredInputStream;
+import io.grpc.KnownLength;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -46,7 +47,8 @@ import javax.annotation.Nullable;
/**
* Implementation of {@link DeferredInputStream} backed by a nano proto.
*/
-public class DeferredNanoProtoInputStream extends DeferredInputStream<MessageNano> {
+public class DeferredNanoProtoInputStream extends DeferredInputStream<MessageNano>
+ implements KnownLength {
// DeferredNanoProtoInputStream is first initialized with a *message*. *partial* is initially
// null.
@@ -128,10 +130,4 @@ public class DeferredNanoProtoInputStream extends DeferredInputStream<MessageNan
}
return 0;
}
-
- @Override
- @Nullable
- public MessageNano getDeferred() {
- return message;
- }
}