Top Description Methods
javax.usb

public Interface UsbStringDescriptor

extends UsbDescriptor
Imports
java.io.UnsupportedEncodingException

Interface for a USB string descriptor.
Author
Dan Streetman

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

This descriptor's bString.
bString
()

Get this descriptor's bString.

public String

Returns:

This descriptor's String.
getString
()

Get this descriptor's translated String.

Inherited from javax.usb.UsbDescriptor:
bDescriptorTypebLength

Method Detail

bStringback to summary
public byte[] bString()

Get this descriptor's bString.

Modifications to the returned byte[] will not affect the StringDescriptor's bString (i.e. a copy of the bString is returned).

Returns:byte[]

This descriptor's bString.

getStringback to summary
public String getString() throws UnsupportedEncodingException

Get this descriptor's translated String.

This is the String translation of the bString. The translation is done using the best available Unicode encoding that this JVM provides. USB strings are 16-bit little-endian; if no 16-bit little-endian encoding is available, and the string can be converted to 8-bit (all high bytes are zero), then 8-bit encoding is used. If no encoding is available, an UnsupportedEncodingException is thrown.

For information about Unicode see the Unicode website.

Returns:String

This descriptor's String.

Exceptions
UnsupportedEncodingException:
If no encoding is available.