Drop a proper finalizer in RandomAccessFile to catch resource leaks.

http://b/3015023
Change-Id: Ic938c82d3353a2231619f2bd87e4480a2b57c622

Conflicts:
	luni/src/main/java/java/io/RandomAccessFile.java
Fix our byte order behavior for slice and wrap operations.

Our documentation was correct, but our implementation was not. Includes
extensive new tests.

Bug: 3066167
Change-Id: Ie7d6e6432f1d675f20af020cc662dab6eb181a50
Fix getLong/getDouble for byte[]-backed nio Buffers.

A regression I introduced. Happily, the correct version doesn't sacrifice speed.

Bug: 3066167
Change-Id: Idef17012b8d84a05644ba161bfdc462a38cf3326
Revised CloseGuard usage pattern

- CloseGuard.get() instants are now "unopened"
- In constructor cases, guard.open("...") is now at the end
- In metod cases, guard.open("...") is now after resource acquisition
- guard null pointer checks in finalizers in case constructor threw exception

Bug: 2645458
Change-Id: Ieb874a8c33b347768a9fa7437b3dd16f3d56d886
Add a hidden method to clear our Java-level DNS cache.

So the network guys can call this when the network changes, in case addresses
that were valid on that network aren't valid on the new network.

Change-Id: I07175b9b754bb4745a2f78b43f024723891c3f05
Give every NumberFormatException a useful detail message.

Bug: 3095335
Change-Id: If0409c6328c2fa2a35e5027e20b4786fe87e693b
Remove more tabs.

Missed these in the big cleanup because they didn't look like code we were maintaining. The
xalan/xpath/et cetera stuff is all still tab-filled, and there are a few package.html files
too (for which I've raised http://b/3107546).

Change-Id: I7ad956f3c410701fec13731c9affbcedd24a4a9a
Add and use STATIC_ASSERT for compile-time asserts, and remove some 32-bit limits.

This started with the question "are the fields in struct statfs really 64-bit?",
but grew a bit. I'll need ftruncate64 in bionic before we can kill
offsetTooLarge completely.

Change-Id: Ia1dcda49e2c93c3cb0f9efe61a70c667c1415bee
Rewrite ProxySelector and write a test to go with it.

http://b/3097518

Change-Id: Ic6b28ab21e00b6b55a01ae7927b87ac0d0375b44
Follow up on HTTP proxy selector docs.

Change-Id: Ib1e5071f112deb5129ea721836e028a26045fb91
http://b/3097518
Remove Engine.spi memory leak by clearing after access

Also other minor code cleanup such as:
- made assorted fields final
- fixed lazy initialization without volatile or sync

Bug: 1322442
Change-Id: I34e428dff5f07a7291d635c724111d44f2deff1c
Change Engine.getInstance interfaces to make usage less error prone

Change-Id: I4c58c95ab4216b52aa8af4fbce7a8d7f4860c2b7
Factor out the code that peeks/pokes ints/longs/shorts from a byte[].

My intention here is that I'll want to reuse this code in my BufferIterator
for byte[]s (http://b/3032515).

This actually makes a noticeable nio benchmark improvement, presumably because
of the switch to static methods, so this helps http://b/2985452 too.

I plan on experimenting with native implementations for the new OSMemory
methods, but that can wait.

Change-Id: Ie5b34910b1e99930ba1f13c0e7002245b901039b
BufferIterator support for byte[].

Bug: 3032515
Change-Id: I040a92c3ce241aa97719ff94e3cc31c62473bf46
Improve Data(Input|Output)(Stream)? documentation.

Bug: 3032515
Change-Id: I2e9574507a05ff5fa48ee6c85f0ce619c230baa6
Improve our modified UTF-8 implementation.

I was out looking for customers for the new OSMemory peek/poke for byte[]s,
and ran into this mess. I also noticed we didn't have any real tests for
DataOutputStream. This patch rewrites DataOuputStream and ObjectOutputStream
to be simpler and cleaner, pulls modified UTF-8 encoding support out into
ModifiedUtf8 where it belongs, and adds a new special ICU-avoiding case for
String.getBytes("UTF-16BE"). And adds tests.

Bug: 3032515
Change-Id: I618c8b1bda13138feed7710e29aee0f96f2e9b95
Move improved cert chain handling from CertificateChainValidator to TrustManagerImpl

Bug: 2658463

Change-Id: I014ebfee1f6e2f46b7a842b5bbf6549bf484f3c0