需要编一个程序来显示并复制文件内容, 文件内容要转换成大写字母显示.. 内容自定..我刚涉及JAVA 不知道怎么转换成大写, 把复制写好了 , 哪位能指点一下吗?import java.io.FileInputStream;
import java.io.*;public class Sj1 {
    public Sj1() {
    }    public static void main(String[] args) {
        try {
            File file = new File(args[0]);                if(file.isDirectory())
                {
                    System.out.println(args[0]+"是目录!");
                }
                else
                {
                    if(file.exists())
                    {
                        FileInputStream fis = new FileInputStream(args[0]);
                        DataInputStream dis = new DataInputStream(fis);
                        FileOutputStream fos = new FileOutputStream(args[1]);
                        DataOutputStream dos = new DataOutputStream(fos);                        try {
                            int i ;
                            while((i = dis.read()) != -1)
                            {
                                dos.write(i);
                            }
                        } catch (IOException ex1) {
                        }                    }                }        } catch (FileNotFoundException ex) {        }
        catch(ArrayIndexOutOfBoundsException e)
        {
            System.out.println("请输入参数!");
        }
    }
}

解决方案 »

  1.   

    String str = ....;
    str = str.toUpperCase(); // 变大写字母
      

  2.   

    FileInputStream   fis   =   new   FileInputStream(args[0]); 最好封装成BufferedReader reader = new BufferedReader (new InputStreamReader(fid));    String str = "";
        while ((str = reader .readLine()) != null) {
          str = str.toUpperCase();
    ... // 输出    }
      

  3.   

    输出可以封装成
    PrintWriter  out = new PrintWriter (dos);out.println(str); // 输出
      

  4.   

    得用AIIS码啊,好象A是65吧,a 是97吧,我也不记得了,你去看书吧
    反正这个方法可以解决的