aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Duff <bduff@google.com>2015-02-17 17:47:49 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-17 17:47:50 +0000
commit971aedc78cbafac28e521808710574803708202f (patch)
treec8b0be96b287b9fee1d60ec799ed07a3d657bed7
parenteb5ae9e258a8fc953e6cf0b3a0dd04a112a05a3c (diff)
parent173957cc7c87dec3bf849fc1756a2ee1f22dcd5f (diff)
downloadexternal_protobuf-971aedc78cbafac28e521808710574803708202f.zip
external_protobuf-971aedc78cbafac28e521808710574803708202f.tar.gz
external_protobuf-971aedc78cbafac28e521808710574803708202f.tar.bz2
Merge "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.