Parallel ports are most common on PCs. Sun SparcStations from the Sparc V on also have them. However, Macs do not have them, nor do many non-x86 workstations. Parallel ports are sometimes called printer ports, because their original purpose was to support printers. The names of the parallel ports—“LPT1,” “LPT2,” etc.—stand for “Line PrinTer,” reflecting this usage. Nowadays, parallel ports are also used for Zip drives, tape drives, and various other devices. However, parallel ports are still largely limited by their original goal of providing simple printing. A parallel port sends data eight bits at a time on eight wires. These bits are sent at the same time in parallel, hence the name. The original parallel ports only allowed data to flow one way, from the PC to the printer. The printer could only respond by sending a few standard messages on other wires. Each return wire corresponded to a particular message, like “Out of paper” or “Printer busy.” Modern parallel ports allow full, bidirectional communication.
class is a concrete subclass of
javax.comm.CommPort that provides various methods
and constants useful for working with parallel ports and devices. The
main purposes of the class are to allow the programmer to inspect,
adjust, and monitor changes in the settings of the parallel port.
Simple input and output are accomplished with the methods of the
ParallelPort has a single public constructor, but that shouldn’t ...