⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readfrompipe.java

📁 Practical Java也是一本和J2ME手机游戏开发相关的书
💻 JAVA
字号:
class ReadFromPipe extends Thread
{
  private Pipe pipe;

  //...
  public void run()
  {
    int data;
    while(true)
    {
      while((data = pipe.getData()) == 0)
      {
        //No data, so sleep for a while and try again.
        try {
          sleep(200);
        }
        catch(InterruptedException e){}  //Exception is ignored
      }                                  //purposefully.
      synchronized(pipe) {
        //Process data
      }
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -