public static final boolean copyFileNio(File src, File dst)
            throws IOException
    {
        FileChannel srcChannel = null, dstChannel = null;
        try
        {
            // Create channel on the source
            srcChannel = new FileInputStream(src).getChannel();

            // Create channel on the destination
            dstChannel = new FileOutputStream(dst).getChannel();

            // // Copy file contents from source to destination
            // dstChannel.transferFrom(srcChannel, 0, srcChannel.size());

            {
                // long theoretical_max = (64 * 1024 * 1024) - (32 * 1024);
                int safe_max = (64 * 1024 * 1024) / 4;
                long size = srcChannel.size();
                long position = 0;
                while (position < size)
                {
                    position += srcChannel.transferTo(position, safe_max,
                            dstChannel);
                }
            }

            // Close the channels
             srcChannel.close();
             srcChannel = null;
             dstChannel.close();
             dstChannel = null;

            return true;
        }
        finally
        {
            try
            {
                if (srcChannel != null)
                    srcChannel.close();
            } catch (IOException e)
            {
                Debug.debug(e);

            }
            try
            {
                if (dstChannel != null)
                    dstChannel.close();
            } catch (IOException e)
            {
                Debug.debug(e);

            }
        }
    }