Offer streams API for variable substitution on the fly

Description

As of 5.0.10 and before, there is available just the utility class VariableSubstitutorImpl, offering methods for substituting Izpack variables in texts. If there are used streams, they are separately copied from input to output streams using the java I/O API. There is neither a Reader or a stream available for directly substituting variables during the read operation.

Offer a

  • VariableSubstitutorInputStream

  • VariableSubstitutorReader

implementing basic java.io interfaces and offering variable substitution on the fly.

Environment

None

Activity

Show:
Wang Jessie
January 30, 2018, 10:14 AM
Edited

VariableSubstitutorImpl.java

substitute(InputStream in, OutputStream out, SubstitutionType type, String encoding) method is not encode OutputStream Data

If xml element contains big5 value, the element in the output xml is garbled.

P.S. I use version 5.1.2

René Krell
January 30, 2018, 1:22 PM

VariableSubstitutorImpl.java
substitute(InputStream in, OutputStream out, SubstitutionType type, String encoding) method is not encode OutputStream Data
If xml element contains big5 value, the element in the output xml is garbled.
P.S. I use version 5.1.2

Can you please send an example call, did you set an explicit encoding in the parameter list or just null?
Can you add a simple example file which did not pass the substitution correctly, please?

Wang Jessie
January 31, 2018, 1:10 AM
Edited

Original.xml is


Output file is

They 'are different in the xml elemenet - <title>.

I add main method in VariableSubstitutorImpl.

Evgeniy Egorov
February 13, 2018, 1:04 PM
Edited

The same problem.

Assignee

René Krell

Reporter

René Krell

Impact

Code optimizations and cleanup - safe for all environments

Components

Sprint

None

Fix versions

Affects versions

Priority

Low
Configure