Also replaced some JNI code with libcore IO support Change-Id: I091e2b6b8dd1fec554936c1ffab29e50f0979e4a