📄 j_echo1.java
字号:
// ////////////////////////////////////////////////////////
//
// J_Echo.java
//
// ////////////////////////////////////////////////////////
import java.io.InputStream;
import java.io.IOException;
public class J_Echo1
{
public static void mb_echo(InputStream in)
{
try
{
while (true) // Read input and echo
{
int n = in.available( );
if (n > 0)
{
byte[ ] b = new byte[n];
if (in.read(b) == -1)
return;
String s = new String(b);
System.out.print(s);
}
} // End of loop: while
}
catch (IOException e)
{
System.err.println(e);
} // End of try/catch structure
System.out.println( );
} // End of method: mb_echo
public static void main(String args[])
{
mb_echo(System.in);
} // End of method: main
} // End of class: J_Echo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -