package net;/** * @author blurxx * @version 1.0 */ import java.io.FileWriter;import java.io.IOException;import java.io.*;class FileWrite { public static void main(String args[]) { StringBuffer buf=new StringBuffer(); try { FileOutputStream out=new FileOutputStream("text.txt",true); BufferedOutputStream reader=new BufferedOutputStream(out); char c; while((c = (char)System.in.read()) != ' ') { buf.append(c); } byte b[]=buf.toString().trim().getBytes("ISO8859_1"); Title: reader * * Description: * * Copyright: Copyright (c) 2007 * * Company: * * reader.flush(); reader.write(b,0,b.length); reader.close(); } catch(IOException e) { System.out.println("读写操作出现异常!"); System.exit(-1); } }}