Наверно, я неправильно понял условия задачи, но что в этом решении не так?
package com.javarush.task.task22.task2211;
import java.io.*;
public class Solution
{
public static void main(String[] args) throws IOException
{
if (args.length > 0)
{
try (
FileInputStream fis = new FileInputStream(args[0]);
FileOutputStream fos = new FileOutputStream(args[1])
)
{
byte[] buffer = new byte[fis.available()];
fis.read(buffer);
String contents = new String("UTF-8");
buffer = contents.getBytes("Windows-1251");
fos.write(buffer);
}
catch (FileNotFoundException ex) {}
}
else System.out.println("No right parameters specified");
}
}