extend ByteBuffer support

rename putBytes(ByteBuffer, T) to write(ByteBuffer, T) to match nio
api. add T read(ByteBuffer) for symmetry.