×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On 2010/10/26 7:12 PM, Marvin Radding wrote:
public static byte[] toByteArray(InputStream stream)
I have defined it in RPG/ILE as
D toByteArray...
D pr 4096a
D extproc(*java
D :'org.apache.poi.util.IOUtils'
D :'toByteArray')
Besides the missing parameter that Scott mentioned, you're missing the
STATIC keyword on the RPG prototype to match the static keyword for the
Java method.
D toByteArray...
D pr 4096a static
D extproc(*java
D :'org.apache.poi.util.IOUtils'
D :'toByteArray')
D stream o class(*java ...)
For a non-static method, you have to pass an object "instance" of the
method's class when you call the method. In Java, you would code like
this to call a method on a particular object instance:
myObjInstance->toByteArray(parm);
In RPG, you code the object instance as the first parameter on the call.
So you apparently pass one more parameter than is coded in the prototype.
toByteArray(myObjInstance : parm);
For a static method, the method is not instance-specific, so the RPG
call requires has the same number of parameters as are coded in the
prototype.
So when you didn't have either STATIC nor the parameter before, the RPG
compiler expected one parameter. When you added the parameter to the
prototype but not the STATIC keyword, the RPG compiler expected two
parameters. If you add the STATIC keyword, the RPG compiler will again
expect just one parameter.
As an Amazon Associate we earn from qualifying purchases.