IMO, you’re optimizing prematurely. You do not yet know if this will be too slow nor exactly what the performance hit might be. Give the steps a try. You may be surprised to find it might be fast enough.
If I were to change anything about the steps I might use something other than appendToDocumentList. I’d replace it with my own service that adds the line to a Collection of some sort, perhaps a LinkedList. Then have another service that converts that collection to the form needed to write to the file.
Use of an index implies that all lines are in memory in some way.
The node iterator is intended to be fast and memory efficient. Give it a chance.
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB