Add some helper functions/constructors to ArraySlice

The ArraySlice has some nice functions for dealing with arrays. Add
helper constructors to make an ArraySlice out of the commonly used
LengthPrefixedArray and their pointers. Also add some convenience
things such as getting the offset of an element and tightening the
Contains check to ensure that the input is properly aligned.

Test: ./test.py --host
Bug: 140891089
Change-Id: If8350c5716db943d86cae32ed7b17aa8f036c978
1 file changed