private String getEndpointText(final UsbEndpoint endpoint, final int index) {
final String addressInBinary = padLeft(Integer.toBinaryString(endpoint.getAddress()), "0", 8);
final String addressInHex = padLeft(Integer.toHexString(endpoint.getAddress()), "0", 2);
final String attributesInBinary = padLeft(Integer.toBinaryString(endpoint.getAttributes()), "0", 8);
String endpointText = "#" + index + "\n";
endpointText += getString(R.string.address_) + "0x" + addressInHex + " (" + addressInBinary + ")\n";
endpointText += getString(R.string.number_) + endpoint.getEndpointNumber() + "\n";
endpointText += getString(R.string.direction_) + UsbConstantResolver.resolveUsbEndpointDirection(endpoint.getDirection()) + "\n";
endpointText += getString(R.string.type_) + UsbConstantResolver.resolveUsbEndpointType(endpoint.getType()) + "\n";
endpointText += getString(R.string.poll_interval_) + endpoint.getInterval() + "\n";
endpointText += getString(R.string.max_packet_size_) + endpoint.getMaxPacketSize() + "\n";
endpointText += getString(R.string.attributes_) + attributesInBinary;
return endpointText;
}