Skip to Main Content
Java I/O, 2nd Edition
book

Java I/O, 2nd Edition

by Elliotte Rusty Harold
May 2006
Beginner to intermediate content levelBeginner to intermediate
726 pages
19h 57m
English
O'Reilly Media, Inc.
Content preview from Java I/O, 2nd Edition

Chapter 23. USB

RS-232 serial ports are one of the oldest I/O technologies still in use today. They really haven’t changed a lot in the last 20 years. RS-232 serial ports work reliably and work well, but a 20-year-old technology designed for 300-baud modems, daisy-wheel printers, and 16-bit processors with 4.77-MHz clock rates doesn’t suffice for digital video, DVD burners, and optical mice. Consequently, more modern computers have switched to a different serial protocol known as Universal Serial Bus (USB).

Hardware-wise, USB is much faster and thus better suited for the data transfer needs of today’s more bandwidth-hungry devices. USB also uses a different connector that’s much easier to plug in and unplug and less susceptible to bent pins and broken ports. USB cables carry power as well as data, so small USB devices that don’t draw a lot of current don’t need separate power cords. However, to a Java programmer there are two key differences:

  1. Many different devices can be connected to the same USB port. Indeed, up to 127 different devices may be daisy chained to a single USB controller.

  2. Data is sent to and received from USB devices in individual I/O request packets (IRPs). The stream classes are not used.

This makes communicating with USB devices more complex than reading and writing the streams from the single device on a serial port.

There are several extant versions of USB. The basic architecture and APIs are the same regardless of version. As a software developer or end user, the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java I/O

Java I/O

Elliotte Rusty Harold
Java NIO

Java NIO

Ron Hitchens

Publisher Resources

ISBN: 0596527500Errata PageSupplemental Content