#fixed code
                             public static long copy(File src, File dest, long position, long count) throws IOException {
		try(FileInputStream in = new FileInputStream(src);
			FileOutputStream out = new FileOutputStream(dest);
			FileChannel inChannel = in.getChannel();
			FileChannel outChannel = out.getChannel();) {
			return inChannel.transferTo(position, count, outChannel);
		} 
	}
#vulnerable code 
                             public static long copy(File src, File dest, long position, long count) throws IOException {
		FileInputStream in = new FileInputStream(src);
		FileOutputStream out = new FileOutputStream(dest);
		FileChannel inChannel = in.getChannel();
		FileChannel outChannel = out.getChannel();
		try {
			return inChannel.transferTo(position, count, outChannel);
		} finally {
			if (inChannel != null)
				inChannel.close();
			if (outChannel != null)
				outChannel.close();
			if (in != null)
				in.close();
			if (out != null)
				out.close();
		}
	} 
                            #location 17 
                            #vulnerability type RESOURCE_LEAK