Teach dex how to parse encoded values from .dex files.

Previously primitive values were treated as opaque byte arrays.
Now the encoded values can be interpreted as their proper types:
integers, indices, floats, chars, etc. This gets complicated
pretty fast due to the dense packing dx performs when encoding
the values.

The encoding code is moved from ValueEncoder. The decoding code
is ported from C++ to Java from Annotation.cpp.

There's a bunch of new tests to make sure the decoding is correct;
porting from C++ to Java was tricky because of the '>>' shifts on
unsigned values. The test input data is generated by dex!

Change-Id: I83b2fc3e16115d667fa94b3dab782d1a9687f3ad
(cherry picked from commit 27847605b9255358f0577ffec28886c450263898)
7 files changed