日期:2014-05-20 浏览次数:20814 次
package c_port_packageDoctor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class Test8 {
FileOutputStream fops = null;
FileInputStream fips = null;
byte[] bytes1 = new byte[1024];
Test8(){
try {
fops = new FileOutputStream("D:\\MyDoc\\test.txt");
fips = new FileInputStream("D:\\MyDoc\\test.txt");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args){
Test8 t8 = new Test8();
t8.start();
t8.GoonStart();
}
public void start(){
try {
byte[] bytes = "19".getBytes();
fops.write(bytes);
//dops.writeInt(19);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void GoonStart(){
try {
bytes1 = fips.read();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(bytes1);
}
}