diff options
author | Shai Barack <shayba@google.com> | 2015-02-17 09:44:48 -0800 |
---|---|---|
committer | Brian Duff <bduff@google.com> | 2015-04-28 12:47:42 -0700 |
commit | 41f0294cd6dc8aed2b3591d3ada9db8debd6a0d6 (patch) | |
tree | 5d81bb2d91b7ffda20ba77012c4c0fa18586bafc /javanano/src | |
parent | 2712c421362994b4617e865ff977cc1c8f37f3d0 (diff) | |
download | protobuf-41f0294cd6dc8aed2b3591d3ada9db8debd6a0d6.tar.gz protobuf-41f0294cd6dc8aed2b3591d3ada9db8debd6a0d6.tar.bz2 protobuf-41f0294cd6dc8aed2b3591d3ada9db8debd6a0d6.zip |
Add reset() and position() to CodedOutputByteBufferNano.
Change-Id: Ie2a9e36276ac35e10b3f8d379b5742d50a0374e9
Diffstat (limited to 'javanano/src')
-rw-r--r-- | javanano/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/javanano/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java b/javanano/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java index d0bc07e4..91fa3353 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java +++ b/javanano/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java @@ -899,6 +899,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. |