writeDirect
Apply block function on a ByteBuffer of the free space. The block function should return number of written bytes.
Return
number of bytes written
Apply block to a native pointer for writing to the buffer. Lambda should return number of bytes were written.
Return
number of bytes written