add read/write byte array API

Improves io performance by ~50%