Use IFSFileWriter for writing character files in the integrated file system. IFSFileWriter is meant for writing streams of characters.
IFSFileWriter is the replacement of IFSTextFileOutputStream.
import java.io.PrintWriter;
import java.io.BufferedWriter;
// Work with /File1 on the system mysystem.
AS400 as400 = new AS400("mysystem");
IFSFile file = new IFSFile(system, "/File1");
PrintWriter writer =
new PrintWriter(new BufferedWriter(new IFSFileWriter(file)));
// Write a line of text to the file, converting characters.
writer.println(text);
// Close the file.
writer.close();