I just interested about the difference between these two guys
ByteBuffer.allocateDirect(4)
and
ByteBuffer.allocate(4)
and why when I call the array()
method of direct one, it throws exception? what is the difference? would you provide a simple example and usage too? many thanks.