Use NIO ByteBuffers for speed-up and simplification

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