// Path: android/Commons/src/triaina/commons/exception/IORuntimeException.java
// public class IORuntimeException extends CommonRuntimeException {
// 	private static final long serialVersionUID = -8000893106100281337L;
// 
// 	public IORuntimeException() {
// 	}
// 
// 	public IORuntimeException(String detailMessage, Throwable throwable) {
// 		super(detailMessage, throwable);
// 	}
// 
// 	public IORuntimeException(String detailMessage) {
// 		super(detailMessage);
// 	}
// 
// 	public IORuntimeException(Throwable throwable) {
// 		super(throwable);
// 	}
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import triaina.commons.exception.IORuntimeException;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
     * @param os the output stream
     * @return the number of bytes that were transferred
     * @throws IOException
     */
    public static long copyFileStream(FileInputStream is, FileOutputStream os)
            throws IOException {
        FileChannel srcChannel = null;
        FileChannel destChannel = null;
        try {
            srcChannel = is.getChannel();
            destChannel = os.getChannel();
            return srcChannel.transferTo(0, srcChannel.size(), destChannel);
        } finally {
            CloseableUtils.close(srcChannel);
            CloseableUtils.close(destChannel);
        }
    }

    public static String getName(String path) {
        return new File(path).getName();
    }

    public static String getName(Uri uri) {
        return new File(uri.toString()).getName();
    }

    public static boolean createNewFile(File file) {
        try {
            return file.createNewFile();
        } catch (IOException exp) {
// Path: android/Commons/src/triaina/commons/exception/IORuntimeException.java
// public class IORuntimeException extends CommonRuntimeException {
// 	private static final long serialVersionUID = -8000893106100281337L;
// 
// 	public IORuntimeException() {
// 	}
// 
// 	public IORuntimeException(String detailMessage, Throwable throwable) {
// 		super(detailMessage, throwable);
// 	}
// 
// 	public IORuntimeException(String detailMessage) {
// 		super(detailMessage);
// 	}
// 
// 	public IORuntimeException(Throwable throwable) {
// 		super(throwable);
// 	}
// }


// Path: android/Commons/src/triaina/commons/utils/FileUtils.java
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import triaina.commons.exception.IORuntimeException;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;

     * @param os the output stream
     * @return the number of bytes that were transferred
     * @throws IOException
     */
    public static long copyFileStream(FileInputStream is, FileOutputStream os)
            throws IOException {
        FileChannel srcChannel = null;
        FileChannel destChannel = null;
        try {
            srcChannel = is.getChannel();
            destChannel = os.getChannel();
            return srcChannel.transferTo(0, srcChannel.size(), destChannel);
        } finally {
            CloseableUtils.close(srcChannel);
            CloseableUtils.close(destChannel);
        }
    }

    public static String getName(String path) {
        return new File(path).getName();
    }

    public static String getName(Uri uri) {
        return new File(uri.toString()).getName();
    }

    public static boolean createNewFile(File file) {
        try {
            return file.createNewFile();
        } catch (IOException exp) {
            throw new IORuntimeException(exp);