Commit 15bff99d authored by Andre Eisenbach's avatar Andre Eisenbach Committed by Brian Duff

Handle 0-length byte buffers in micro and nano protobufs

Change-Id: I845ee1ab1005d25c8d77a8c2ed801c0f7b7c847b
parent 16a283f7
......@@ -236,6 +236,8 @@ public final class CodedInputByteBufferNano {
System.arraycopy(buffer, bufferPos, result, 0, size);
bufferPos += size;
return result;
} else if (size == 0) {
return WireFormatNano.EMPTY_BYTES;
} else {
// Slow path: Build a byte array first then copy it.
return readRawBytes(size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment