Improve I/O performance

1. Use InputStream#read(byte[]) instead of InputStream#read(int)
2. Use OutputStream#write(byte[]) instead of OutputStream#write(int)
3. implement OutputStream#write(byte[], int, int) in addition to
   OutputStream#write(int) where feasible

Bug: 23061510
Change-Id: I249864d621da8bebfada1bc2ddb6d1e1b65b9f29
6 files changed