Perry Smith

Java Questions & Answers

Home / Java Q & A Archive Page 3 / Java Q & A Archive

Problem with I/O interface
Wednesday, 03-Feb-99 11:39:16

203.124.1.50 writes:

Hi,
I have this problem. I need to retrieve or send data to/fro the I/O port (parallel port). Most books refer to using the I/O package. However, i have difficulty implementing it to solve my problem. How actually do i specify my data source and destination which is the port itself?
Can anyone provide me with the statements to perform that?

Many Thanks!

Heng


Response
Re: Problem with I/O interface
Thursday, 04-Feb-99 21:09:57

152.172.204.192 writes:

You have to attach an input stream to the port.

      String strPort;
      .
      .
      .
      if ( ... )
      {
      strPort = "LPT1";
      }
      else
      {
      strPort = "COM1";
      }
      .
      .
      .
      java.io.BufferedInputStream = new BufferedInputStream(strPort);

      Hope that helps.

      MikeD

Home / Java Q & A Archive Page 3 / Java Q & A Archive