Code example for FileInputStream

Methods: close, getChannel

0
    /** 
     * Moved this code into it's own method so moveTo could use it when the move is across file systems 
     */ 
    private void copyAction(File srcFile, File destFile)
            throws FileNotFoundException, IOException { 
        FileInputStream istream = new FileInputStream(srcFile);
        FileOutputStream ostream = new FileOutputStream(destFile);
        FileChannel input = istream.getChannel();
        FileChannel output = ostream.getChannel();
 
        try { 
            input.transferTo(0, input.size(), output);
        } finally { 
            istream.close();
            ostream.close();
            input.close();
            output.close();
        } 
    } 
 
    /**