📄 streamhandler.java
字号:
package isis.commons.exec;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* Pumps the data from an input stream to an output stream.
* @author sallai
*
*/
public class StreamHandler extends Thread {
InputStream is;
OutputStream os;
StreamHandler(InputStream is) {
this(is, null);
}
StreamHandler(InputStream is, OutputStream os) {
this.is = is;
this.os = os;
}
public void run() {
if(is==null) return;
try {
int c;
while ((c = is.read()) != -1) {
if(os!=null) os.write(c);
}
if (os!=null) os.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
// } finally {
// if (!System.out.equals(os) && !System.err.equals(os)) {
// if (os!=null)
// try {
// os.close();
// } catch (Exception e) {
// }
// }
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -