The CodedInputStream(byte[], int, int), the setting of: bufferSize = *off+ *
len;
would appear to be an error. I expect it should be: bufferSize = len;
(generally, bufferSize is the max value of bufferPos in the buffer byte[])
This leads to various confusion and ArrayIndexOutOfBoundsException when
using a byte[] slice.
For example: CodedInputStream.newInstance("AAAAA".getBytes(),
5,5).isAtEnd() --> *false* [when obviously the buffer is 'empty' at this
point]
and readBytes() will likewise expect to find more bytes than are actually
in the byte[]
Note: There are other inconsistencies (wrt bufferSize & totalBytesRetired)
in refillBuffer, where bufferSize is not what it seems (when using a byte[]
slice)
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/protobuf/-/061P13a3AgsJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.