解决方案 »
- 用mina2做的消息系统服务,程序重新启动端口被占用问题, 标题要长 .................
- 请问一个工程有多个package怎么用-jar打包?
- 关于读取网址源代码乱码
- 使JMF支持RM,实现rm/rmvb文件的网络传输和播放?
- 帮忙看下这个程序错在哪里?
- java存储过程 不能解析问题
- 怎么样用java写程序将主从数据库(oracle)实现数据传输和下载?请各位大侠帮忙!!!
- java有没有openfiledialog,savefiledialog等对话框?
- 在Java中(web端)如何打开或者新建word文档?如解决,高分相送!!
- 急:ODBC-JDBC桥编程的错误信息
- Java高手请进 传值与传地址 非诚勿扰……
- JTable显示问题,很迷惑!
OutputStream oStream = null;
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"); }}