|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--usb.util.USBSocket
This provides basic access to USB interfaces which use only bulk I/O, and for devices which only offer such interfaces. Such access is found in many digital still cameras (including all current Kodak USB-aware cameras, and other cameras using the Digita OS), the Diamond Rio500 MP3 player, and other USB devices.
As with network sockets, be sure to close() these when you're no longer accessing the device. That permits other software to connect to the device.
Constructor Summary | |
USBSocket(Device dev)
Initializes the socket using a bulk-only device. |
|
USBSocket(Interface intf)
Initializes the socket using a bulk-only interface on a device which may have additional interfaces. |
Method Summary | |
void |
close()
Releases the interface, so that some other software driver can use it to access this device. |
protected void |
finalize()
Finalization releases the interface, if it has not already been released by invoking close(). |
Device |
getDevice()
Returns the device to which this socket is connected, or null if the device has been closed or removed. |
java.io.InputStream |
getInputStream()
Returns an input stream used to perform bulk reads from the interface, or null. |
java.io.OutputStream |
getOutputStream()
Returns an output stream used to perform bulk writes to the interface, or null. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public USBSocket(Device dev) throws java.io.IOException
java.io.IOException
- if the interface is already claimed by
another driver module; or if the configuration, interface, or
endpoints can't be accessed; and for other reasons.java.lang.IllegalArgumentException
- if the interface doesn't
have exactly two endpoints, for bulk input and bulk output.public USBSocket(Interface intf) throws java.io.IOException
java.io.IOException
- if the interface is already claimed by
another driver module, or if the endpoints can't be accessed.java.lang.IllegalArgumentException
- if the interface doesn't
have exactly two endpoints, for bulk input and bulk output.Method Detail |
public void close() throws java.io.IOException
protected void finalize() throws java.io.IOException
finalize
in class java.lang.Object
public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public Device getDevice()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |