Fix how getRepeatedFieldArrayLength works

Change-Id: I01921eff008a8e3f7b1fbeb653d15ff8038d3220
Keep pointers to extension values.

The current implementation of getExtension deserialises the field from bytes
and returns a new object every time. This means that changes to those objects
are reflected when the messages is serialised unless setExtension is called. It
also means that every call to getExtension and setExtension is expensive.

This change introduces a FieldData class that contains everything that's known
about the field at the time. This can be all the tag/byte[] pairs associated
with a given field or an Extension and a value object. This is so that two
messages with a repeated extension can be compared even if the extension
has been deserialised in one of them but not the other.

This change also adds FieldArray class based on SparseArray from the Android
compatibility library. This is used in ExtendableMessageNano to make lookup
of FieldDatas by their field number faster.

Implications:
* calling getExtension multiple times deserialises the field only once and
  returns the same object.
* calling setExtension doesn't cause the object to be serialised immediately,
  that only happens when the container message is serialised.
* getExtension is no longer a read-only thread-safe operation. README.txt has
  been updated to relfect that.
* comparison using equals and hashCode continues to work.

Bug: 10863158

Change-Id: I81c7cb0c73cc0611a1f7c1eabf5eed259738e8bc
Merge "Keep pointers to extension values."
Fix access around unknownFieldData.

Instead of publishing its class I chose to encapsulate the troublesome
references in equals()/hashCode() in the generated code into superclass
methods in ExtendableMessageNano.

Changed a couple of java packages in the test suite to catch this issue
easier in the future.

Change-Id: I43f88411f63bb6f3ffc8d63361f2f77bebf6220a
Merge "Fix access around unknownFieldData."
Add a hasExtension method to ExtendableMessageNano.

It allows checking for the presence of an extension without having to
deserialize the field.

Change-Id: Id542d20274b2435b7bc2b322740e9984cb8639a1
Merge "Add a hasExtension method to ExtendableMessageNano."
Don't return NULL from {Boxed}PrimitiveTypeName.

The behavior of the string ctor is undefined when you pass NULL. This
is checked strictly in C++11, so fails to compile.

Change-Id: Id5e0984ad1d37f2d504f7c42ac23e52ed4a58903
Merge "Don't return NULL from {Boxed}PrimitiveTypeName."
Fix the aprotoc target for Windows.

Allows aprotoc.exe to be cross-compiled when building the Windows SDK.

Change-Id: I7e1eec945b5578e1fe6c368b128fe1f9396f491c
Merge "Fix the aprotoc target for Windows."
Merge "Fix how getRepeatedFieldArrayLength works"
Fixed octal printing of bytearrays

Change-Id: Ia848d7fae9aeab89e65b00f05cee6c1e6d649d94
Merge "Fixed octal printing of bytearrays"
Revert "Fixed octal printing of bytearrays"

This reverts commit 8b8481868877c9db407d04bdf4843e50d8920806.

Change-Id: I0876235b79cd7745312879d0f1b00c6d1c1a1b7a
Merge "Revert "Fixed octal printing of bytearrays""
Fixed octal printing of bytearrays

 - Now with 50% less '&' and 100% fewer build breakages!

Change-Id: Icf0283220f75cd14b8564b51bd55973e5b7da56b
Merge "Fixed octal printing of bytearrays"
Add MessageNano.messageNanoEquals().

Allows two messages to be compared directly for equality without
generating an equals method for every generated message.

(Ports CL58125010)

Change-Id: I92ab5088539d1fd722fee7b5e28a8c825926c3b6
Merge "Add MessageNano.messageNanoEquals()."