Top Description Inners Constructors Methods
javax.usb.util

public Class UsbUtil

extends Object
Class Inheritance
Imports
java.io.UnsupportedEncodingException, java.util.*, javax.usb.*, javax.usb.event.*

General utility methods.
Author
Dan Streetman

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
UsbUtil.SynchronizedUsbDevice

A synchronized UsbDevice wrapper implementation.

public static class
UsbUtil.SynchronizedUsbPipe

A synchronized UsbPipe wrapper implementation.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

A String representing the speed Object.
getSpeedString
(Object
The device-speed Object.
object
)

Get a String description of the specified device-speed Object.

public static UsbDevice

Returns:

A synchronized UsbDevice.
synchronizedUsbDevice
(UsbDevice
The unsynchronized UsbDevice.
usbDevice
)

Create a synchronized UsbDevice.

public static UsbPipe

Returns:

A synchronized UsbPipe.
synchronizedUsbPipe
(UsbPipe
The unsynchronized UsbPipe.
usbPipe
)

Create a synchronized UsbPipe.

public static String
toHexString(byte
the byte to convert
b
)

Format a byte into a proper length hex String.

public static String
toHexString(short
the short to convert
s
)

Format a short into a proper length hex String.

public static String
toHexString(int
the integer to convert
i
)

Format a int into a proper length hex String.

public static String
toHexString(long
the long to convert
l
)

Format a long into the specified length hex String.

public static String
toHexString(long
the long to convert
l
,
char
the character to use for padding
c
,
int
the min length of the resulting String
min
,
int
the max length of the resulting String
max
)

Format a long into the specified length hex String.

public static String

Returns:

A String representing the byte[].
toHexString
(String
The delimiter to prefix every byte with.
delimiter
,
byte[]
The byte[] to convert.
array
,
int
The number of bytes to use.
length
)

Format a byte[] into a hex String.

public static String

Returns:

A String representing the short[].
toHexString
(String
The delimiter to prefix every short with.
delimiter
,
short[]
The short[] to convert.
array
,
int
The number of shorts to use.
length
)

Format a short[] into a hex String.

public static String

Returns:

A String representing the int[].
toHexString
(String
The delimiter to prefix every int with.
delimiter
,
int[]
The int[] to convert.
array
,
int
The number of ints to use.
length
)

Format a int[] into a hex String.

public static String

Returns:

A String representing the long[].
toHexString
(String
The delimiter to prefix every long with.
delimiter
,
long[]
The long[] to convert.
array
,
int
The number of longs to use.
length
)

Format a long[] into a hex String.

public static String

Returns:

A String representing the byte[].
toHexString
(String
The delimiter to prefix every byte with.
delimiter
,
byte[]
The byte[] to convert.
array
)

Format a byte[] into a hex String.

public static String

Returns:

A String representing the short[].
toHexString
(String
The delimiter to prefix every short with.
delimiter
,
short[]
The short[] to convert.
array
)

Format a short[] into a hex String.

public static String

Returns:

A String representing the int[].
toHexString
(String
The delimiter to prefix every int with.
delimiter
,
int[]
The int[] to convert.
array
)

Format a int[] into a hex String.

public static String

Returns:

A String representing the long[].
toHexString
(String
The delimiter to prefix every long with.
delimiter
,
long[]
The long[] to convert.
array
)

Format a long[] into a hex String.

public static int

Returns:

An int representing the bytes.
toInt
(byte
The byte to be left-shifted 24 bits.
byte3
,
byte
The byte to be left-shifted 16 bits.
byte2
,
byte
The byte to be left-shifted 8 bits.
byte1
,
byte
The byte that will not be left-shifted.
byte0
)

Convert 4 bytes into an int.

public static int

Returns:

An int representing the shorts.
toInt
(short
The Most Significant Short.
mss
,
short
The Least Significant Short.
lss
)

Convert 2 shorts into an int.

public static long

Returns:

A long representing the bytes.
toLong
(byte
The byte to be left-shifted 56 bits.
byte7
,
byte
The byte to be left-shifted 48 bits.
byte6
,
byte
The byte to be left-shifted 40 bits.
byte5
,
byte
The byte to be left-shifted 32 bits.
byte4
,
byte
The byte to be left-shifted 24 bits.
byte3
,
byte
The byte to be left-shifted 16 bits.
byte2
,
byte
The byte to be left-shifted 8 bits.
byte1
,
byte
The byte that will not be left-shifted.
byte0
)

Convert 8 bytes into a long.

public static long

Returns:

A long representing the shorts.
toLong
(short
The short to be left-shifted 48 bits.
short3
,
short
The short to be left-shifted 32 bits.
short2
,
short
The short to be left-shifted 16 bits.
short1
,
short
The short that will not be left-shifted.
short0
)

Convert 4 shorts into a long.

public static long

Returns:

A long representing the ints.
toLong
(int
The Most Significant Int.
msi
,
int
The Least Significant Int.
lsi
)

Convert 2 ints into a long.

public static short

Returns:

A short representing the bytes.
toShort
(byte
The Most Significant Byte.
msb
,
byte
The Least Significant Byte.
lsb
)

Convert 2 bytes into a short.

public static int

Returns:

An unsigned int representing the specified byte.
unsignedInt
(byte
the byte to convert.
b
)

Get the specified byte's value as an unsigned integer.

public static int

Returns:

An unsigned int representing the specified short.
unsignedInt
(short
the short to convert.
s
)

Get the specified short's value as an unsigned integer.

public static long

Returns:

An unsigned long representing the specified byte.
unsignedLong
(byte
the byte to convert.
b
)

Get the specified byte's value as an unsigned long.

public static long

Returns:

An unsigned long representing the specified short.
unsignedLong
(short
the short to convert.
s
)

Get the specified short's value as an unsigned long.

public static long

Returns:

An unsigned long representing the specified int.
unsignedLong
(int
the int to convert.
i
)

Get the specified int's value as an unsigned long.

public static short

Returns:

An unsigned short representing the specified byte.
unsignedShort
(byte
the byte to convert.
b
)

Get the specified byte's value as an unsigned short.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait