@SuppressWarnings("unchecked") public static <S extends NativeObject>S toObject(Class<S> type,long handle){
  try {
    Method toObject=findMarshaler(type);
    return (S)toObject.invoke(null,type,handle,MarshalerFlags.CALL_TYPE_PTR);
  }
 catch (  InvocationTargetException e) {
    throw new Error(e);
  }
catch (  IllegalAccessException e) {
    throw new Error(e);
  }
}

@ SuppressWarnings ( "unchecked" ) public static < S extends NativeObject > S toObject ( Class < S > type , long handle ) { try { Method toObject = findMarshaler ( type ) ; return ( S ) toObject . invoke ( null , type , handle , MarshalerFlags . CALL_TYPE_PTR ) ; } catch ( InvocationTargetException e ) { throw new Error ( e ) ; } catch ( IllegalAccessException e ) { throw new Error ( e ) ; } }
convenience method which finds a marshaler method and runs it converting the specified handle to the specified type .
