FileDocCategorySizeDatePackage
PrimeReader.javaAPI DocExample429Sun Mar 28 07:20:20 BST 1999None

PrimeReader.java

import java.io.*;

public class PrimeReader extends Thread {

  DataInputStream theInput;

  public PrimeReader(InputStream in) 
   throws IOException {
    theInput = new DataInputStream(in);
  }

  public void run() {

    try {
      while (true) {
        System.out.println(theInput.readInt());
      }
    }
    catch (IOException e) {
      // probably just an end of stream exception
    }

  }

}