This was caused by the using a single index for both the input buffer
and the output buffer. Since percent encoding causes more space to be
used, any percent encoding would make the index inaccurate for one of
the strings -- in this case the output string.
I added tracking of the output index by creating an ArrayList and
appending to it.
This was caused by the using a single index for both the input buffer and the output buffer. Since percent encoding causes more space to be used, any percent encoding would make the index inaccurate for one of the strings -- in this case the output string.
I added tracking of the output index by creating an ArrayList and appending to it.