Article View: cn.bbs.comp.lang.java
Article #11950���������������Ƿ�������
From: ��С
Date: Tue, 24 Aug 2004 08:58
Date: Tue, 24 Aug 2004 08:58
48 lines
1963 bytes
1963 bytes
import java.io.*;
public class TestBufferedStreams {
public static void main(String[] args) {
try {
FileReader input = new FileReader(args[0]);
BufferedReader bufInput = new BufferedReader(input);
FileWriter output = new FileWriter(args[1]);
BufferedWriter bufOutput = new BufferedWriter(output);
String line,wline;
StringBuffer buf;
int count=0;
buf=new StringBuffer();
// read the first line
line = bufInput.readLine();
while ( line != null ) {
// write the line out to the output file
count++;
if(count!=5)
buf.append(line+"\t");
else {
count=0;
buf.append(line+"\n");
//System.out.println(buf);
line=buf.toString();//?--����Ҫ������
bufOutput.write(line, 0, line.length());
buf=new StringBuffer();//-----������Ҫ������
}
// read the next line
line = bufInput.readLine();
}
bufInput.close();
bufOutput.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
--
[m[1;34m�� ��Դ:����ˮ˼Դ bbs.sjtu.edu.cn��[FROM: 202.120.25.105][m
Technical Details
Message-ID:
<4DkAlj$AGS@bbs.sjtu.edu.cn>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!cyclone.bc.net!sjc1.usenetserver.com!news.usenetserver.com!maily.cic.tsinghua.edu.cn!netnews.sdu.edu.cn!SJTUShow Full Headers
Complete Article Headers
X-Google-Thread: f6cb0,79c7a1838104abbf,start X-Google-Attributes: gidf6cb0,public X-Google-Language: ENGLISH,GB Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!cyclone.bc.net!sjc1.usenetserver.com!news.usenetserver.com!maily.cic.tsinghua.edu.cn!netnews.sdu.edu.cn!SJTU From: zft.bbs@bbs.sjtu.edu.cn (��С) Newsgroups: cn.bbs.comp.lang.java Subject: ���������������Ƿ������� Date: 24 Aug 2004 08:58:16 GMT Organization: ��ˮ˼Դ Message-ID: <4DkAlj$AGS@bbs.sjtu.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: Java/M.1093337853.A