question: private void createAmpResultStreamMethod ( JavaClass jClass , Method method , int resultOffset ) { String methodName = method . getName ( ) ; Class < ? > [ ] parameterTypes = method . getParameterTypes ( ) ; Annotation [ ] [ ] parameterAnns = method . getParameterAnnotations ( ) ; addMethod ( method ) ; CodeWriterAttribute code = createMethodHeader ( jClass , method ) ; code . setMaxLocals ( 1 + 2 * parameterTypes . length ) ; code . setMaxStack ( 10 + 2 * parameterTypes . length ) ; code . pushObjectVar ( 0 ) ; code . getField ( jClass . getThisClass ( ) , "_messageFactory" , MessageFactoryAmp . class ) ; int argLen = parameterTypes . length - 1 ; code . pushObjectVar ( getLength ( parameterTypes , resultOffset ) + 1 ) ; long timeout = _defaultTimeout ; code . pushConstant ( timeout ) ; code . pushObjectVar ( 0 ) ; code . getField ( jClass . getThisClass ( ) , "_serviceRef" , ServiceRefAmp . class ) ; code . pushObjectVar ( 0 ) ; code . getField ( jClass . getThisClass ( ) , fieldName ( method ) , MethodAmp . class ) ; partitionMethod ( code , parameterTypes , parameterAnns ) ; pushParameters ( code , parameterTypes , parameterAnns , 1 , 0 , argLen + 1 , resultOffset ) ; code . invokeInterface ( MessageFactoryAmp . class , "streamResult" , void . class , ResultStream . class , long . class , ServiceRefAmp . class , MethodAmp . class , Object [ ] . class ) ; code . addReturn ( ) ; code . close ( ) ; }
target:  void foo(X a1, Y a2, ResultStream<T> result) { stream(__caucho_getCurrentContext(), cont, timeout, _methodRef, new Object[] {a1, a2}).send(); }