for (int index = (pin.length-1); index >= 0; index--) {
GpioPin p = pin[index];
// ensure the requested pin has been provisioned
if (!pins.contains(p)) {
throw new GpioPinNotProvisionedException(p.getPin());
}
// remove all listeners and triggers
if (p instanceof GpioPinInput) {
((GpioPinInput)p).removeAllListeners();
((GpioPinInput)p).removeAllTriggers();