Merge pull request #345 from brianduff/update_aosp_again

Handle 0-length byte buffers in micro and nano protobufs
changes/07/233107/1
Jisi Liu 10 years ago
commit 699db2d51a
  1. 2
      javanano/src/main/java/com/google/protobuf/nano/CodedInputByteBufferNano.java

@ -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);

Loading…
Cancel
Save