summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Duff <bduff@google.com>2015-02-17 18:04:52 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-17 18:04:52 +0000
commitaaa31cd17868b9cba27d70e33d008e72ba9f9c8b (patch)
treef47a4d8eb9ec82e21308086ca0689595a997b3a7
parent02171de5bfb6030fd27fb8652bfab12fbf45ac2e (diff)
parentf1c606d95efbfdb7a028dff14f9e8773d30a63b4 (diff)
downloadexternal_protobuf-aaa31cd17868b9cba27d70e33d008e72ba9f9c8b.zip
external_protobuf-aaa31cd17868b9cba27d70e33d008e72ba9f9c8b.tar.gz
external_protobuf-aaa31cd17868b9cba27d70e33d008e72ba9f9c8b.tar.bz2
am f1c606d9: am 971aedc7: Merge "Add reset() and position() to CodedOutputByteBufferNano."
* commit 'f1c606d95efbfdb7a028dff14f9e8773d30a63b4': Add reset() and position() to CodedOutputByteBufferNano.
-rw-r--r--java/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/java/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java b/java/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java
index bedd238..324a63f 100644
--- a/java/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java
+++ b/java/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java
@@ -898,6 +898,23 @@ public final class CodedOutputByteBufferNano {
}
/**
+ * Returns the position within the internal buffer.
+ */
+ public int position() {
+ return buffer.position();
+ }
+
+ /**
+ * Resets the position within the internal buffer to zero.
+ *
+ * @see #position
+ * @see #spaceLeft
+ */
+ public void reset() {
+ buffer.clear();
+ }
+
+ /**
* If you create a CodedOutputStream around a simple flat array, you must
* not attempt to write more bytes than the array has space. Otherwise,
* this exception will be thrown.