Ensure that RandomAccessFile is not leaked.

This change ensures that RandomAccessFile is always closed. Also, it
changes the BufferIterator implementation to delegate to the byte buffer
directly instead of mainitaining the position itself.

Change-Id: I8f93e80c91a7c35e6a7fb015185b8b11e36b6286
2 files changed