Code example for FileInputStream

Methods: closegetChannel

0
	private static String[] BINARY_EXTENSIONS = new String[] { "jar", "gif", "jpg", "jpeg", ".class", "png" };
 
	@Deprecated 
	public static void copy(File source, File target) throws IOException {
		// TODO: copy in FileUtil in commons, this one should be removed. 
		FileInputStream sourceOutStream = new FileInputStream(source);
		FileOutputStream targetOutStream = new FileOutputStream(target);
		FileChannel sourceChannel = sourceOutStream.getChannel();
		FileChannel targetChannel = targetOutStream.getChannel();
		sourceChannel.transferTo(0, sourceChannel.size(), targetChannel);
		sourceChannel.close();
		targetChannel.close();
		sourceOutStream.close();
		targetOutStream.close();
	} 
 
	@Deprecated 
	public static boolean isBinaryFile(File file) {
		// TODO: copy in FileUtil in commons, this one should be removed. 
		String extension = FileUtil.getExtension(file);
Connect your IDE to all the code out there  Get Codota for Java