📄 example9_4.java
字号:
//
//Example9_4.Java-Example9_4的主应用程序
//
import java.io.*;
public class Example9_4
{
public static void main(String[] args)
{
Example9_4 example9_4=new Example9_4();
try
{
FileInputStream xfileln =new FileInputStream("input.txt");
InputStream ylnpipe = example9_4.changetoy(xfileln);
InputStream zlnpipe=example9_4.changetoz(ylnpipe);
System.out.println();
System.out.println("here are the results");
System.out.println();
DataInputStream inputstream = new DataInputStream(zlnpipe);
String str = inputstream.readLine();
while (str!=null)
{
System.out.println(str);
str=inputstream.readLine();
}
inputstream.close();
}
catch(Exception e)
{
System.out.println(e.toString());
}
}
public InputStream changetoy(InputStream inputstream)
{
try
{
DataInputStream xfileln = new DataInputStream(inputstream);
PipedOutputStream pipeout = new PipedOutputStream();
PipedInputStream pipeln = new PipedInputStream(pipeout);
PrintStream printstream = new PrintStream(pipeout);
ythread ythread = new ythread(xfileln,printstream);
ythread.start();
return pipeln;
}
catch(Exception e)
{
System.out.println(e.toString());
}
return null;
}
public InputStream changetoz(InputStream inputsteam)
{
try
{
DataInputStream yfileln = new DataInputStream(inputsteam);
PipedOutputStream pipeout2 = new PipedOutputStream();
PipedInputStream pipeln2 = new PipedInputStream(pipeout2);
PrintStream printstream2 = new PrintStream(pipeout2);
zthread zthread = new zthread(yfileln,printstream2);
zthread.start();
return pipeln2;
}
catch(Exception e)
{
System.out.println(e.toString());
}
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -