How do I do casting in RPG?
Im trying to read a fileinputstream. Im using some example code that uses casting to convert from int to char. I dont know how to set up the prototype for this.
I have the stringbuffer and append method prototyped, but Im coming short with the int to char conversion.
I have the section highlighted (i think). All the other java prototypeing has been handled with the exception of the int->char conversion
//create file object
File file = new File("/tmp/xlstest.xlsx");
int ch;
StringBuffer strContent = new StringBuffer("");
FileInputStream fin = null;
try
{
fin = new FileInputStream(file);
while( (ch = fin.read()) != -1)
strContent.append((char)ch);
fin.close();
}
Im trying to read a fileinputstream. Im using some example code that uses casting to convert from int to char. I dont know how to set up the prototype for this.
I have the stringbuffer and append method prototyped, but Im coming short with the int to char conversion.
I have the section highlighted (i think). All the other java prototypeing has been handled with the exception of the int->char conversion
//create file object
File file = new File("/tmp/xlstest.xlsx");
int ch;
StringBuffer strContent = new StringBuffer("");
FileInputStream fin = null;
try
{
fin = new FileInputStream(file);
while( (ch = fin.read()) != -1)
strContent.append((char)ch);
fin.close();
}
Comment