public void setCapability(int cap,boolean v)throws ScannerIOException{
TwainCapability tc=getCapability(cap,MSG_GETCURRENT);
if(tc.booleanValue()!=v){
tc.setCurrentValue(v);
if(getCapability(cap).booleanValue()!=v){
throw new ScannerIOException(getClass().getName()+".setCapability:\n\tCannot set capability "+TwainCapability.getCapName(cap)+" to "+v);
}
}
}