public static String getString (
	Device dev,
	byte id,
	int language
    ) throws IOException
    {
	byte	buf [];
	int	len;

	if (id == 0)
	    throw new IllegalArgumentException ();
	buf = getStandardDescriptor (dev, Descriptor.TYPE_STRING,
		id, language, 256);

	if (buf.length < 2
		|| buf [1] != Descriptor.TYPE_STRING
		|| (len = 0x0ff & buf [0]) > buf.length
		|| ((len -= 2) % 2) != 0
		) {
	    return null;
	}

	// some JVMs won't handle UTF-16LE ("UnicodeLittle"); convert by hand
	char	data [] = new char [len >> 1];

	for (int i = 0; i < data.length; i++) {
	    int j = (2 * i) + 2;
	    data [i] = (char) ((buf [j + 1] << 8) + (0x0ff & buf [j]));
	}
	return new String (data);
    }