code: public static void arrayCopy(ByteBuffer src, int srcPos, ByteBuffer dst, int dstPos, int length)
  	    {
  	        if (src.hasArray() && dst.hasArray())
  	        {
  	            System.arraycopy(src.array(),
  	                             src.arrayOffset() + srcPos,
  	                             dst.array(),
  	                             dst.arrayOffset() + dstPos,
  	                             length);
  	        }
  	        else
  	        {
  	            if (src.limit() - srcPos < length || dst.limit() - dstPos < length)
  	                throw new IndexOutOfBoundsException();
  
  	            for (int i = 0; i < length; i++)
  	                // TODO: ByteBuffer.put is polymorphic, and might be slow here
  	                dst.put(dstPos++, src.get(srcPos++));
  	        }
  	    }
docs: Transfer bytes from one ByteBuffer to another.
  This function acts as System.arrayCopy() but for ByteBuffers.
  
  @param src the source ByteBuffer
  @param srcPos starting position in the source ByteBuffer
  @param dst the destination ByteBuffer
  @param dstPos starting position in the destination ByteBuffer
  @param length the number of bytes to copy