seqtest.java
来自「《Java程序设计》第6、7、8章的源代码。有需要者请」· Java 代码 · 共 25 行
JAVA
25 行
import java.io.*;
public class SeqTest{
public static void main(String args[]){
FileInputStream fileStream1,fileStream2;
try
{
String allStr;
fileStream1 = new FileInputStream("test1.txt");
fileStream2 = new FileInputStream("test2.txt");
SequenceInputStream seqStream = new SequenceInputStream(fileStream1,fileStream2);
byte[] bufByte = new byte[1024];
while(seqStream.read(bufByte,0,1024)!=-1)
{
String Str = new String(bufByte);
System.out.println(Str);
}
}catch(FileNotFoundException e)
{
System.out.println("File not found or no permission.");
}catch(IOException e)
{
System.out.println("error:"+e);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?