本帖最后由 wlijie 于 2009-11-14 12:20:35 编辑

解决方案 »

  1.   


    OutputStream oStream = null;
      

  2.   

    谢谢.调试成功,其实不用:
    OutputStream oStream = null;
    也可以的.package org.edu.testIntputstream;import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStream;public class TestFileOutput {
        public void write(String path){    
         try {
         OutputStream oStream;
    oStream = new FileOutputStream(path,true);
    String reString = "This is a Test Message! 4    2009/11/14";
    byte [] buff = reString.getBytes();
    oStream.write(buff,0,buff.length);
    oStream.close();
    System.out.println("操作成功!");
    } catch (FileNotFoundException e) {
    // TODO 自动生成 catch 块
    e.printStackTrace();
    } catch (IOException e) {
    // TODO 自动生成 catch 块
    e.printStackTrace();
    }
        }
    public static void main(String[] args) {
    TestFileOutput test = new TestFileOutput();
    test.write("E:\\a.txt"); }}