// call this to print anything between one descriptor and // the next interface or endpoint (or end of configuration) private static void maybePrintDescriptors(int indent, Descriptor d) { while (d != null) { switch (d.getDescriptorType()) { case Descriptor.TYPE_INTERFACE: case Descriptor.TYPE_ENDPOINT: return; default: indentLine( indent, "<descriptor type='" + d.getDescriptorType() + "' length='" + d.getLength() + "'/>"); // dumping contents could be useful too d = d.nextDescriptor(); } } }