RandomAccessFile: support opening for read/write

So far, we only allowed opening in read-only mode. Now, we also support
read/write mode in addition.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add the RandomAccessFile(File file, String mode) constructor

As per the Java API.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add write support for RandomAccessFile

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Fix indentation in java-io.cpp

This was noticed when copy-editing readBytes into writeBytes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Fix potential memory leak in RandomAccessFile#readBytes

This was noticed when copy-editing writeBytes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ByteBuffer: add missing order() methods

Avian's ByteBuffer implementation is actually fixed to big endian. So
let's throw an exception if the user tries to change that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add the BufferUnderflowException

Pre-compiled code might expect the class to exist...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add the FileChannel class

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement a rudimentary RandomAccessFile#getChannel

This implementation is by no means intended to be complete, just enough to
support running http://http://loci.wisc.edu/software/bio-formats's
loci.formats.tools.ImageConverter tool.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>