[protobuf] CodedInputStream bufferSize is set incorrectly when reading from a byte[] slice

2012-10-10 Thread Jack Punt
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

Re: [protobuf] CodedInputStream bufferSize is set incorrectly when reading from a byte[] slice

2012-10-10 Thread Oliver Jowett
On Tue, Oct 9, 2012 at 8:08 AM, Jack Punt thegr...@gmail.com wrote: For example: CodedInputStream.newInstance(A.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[]