public static final ByteBuffer bufferToByteBuffer(final byte[] buffer,final ByteOrder order){
  final ByteBuffer retBuff=ByteBuffer.wrap(buffer);
  retBuff.order(order);
  return retBuff;
}

public static final ByteBuffer bufferToByteBuffer ( final byte [ ] buffer , final ByteOrder order ) { final ByteBuffer retBuff = ByteBuffer . wrap ( buffer ) ; retBuff . order ( order ) ; return retBuff ; }
converts a buffer to a bytebuffer .
