JIRA Issue #1398: https://issues.apache.org/jira/browse/XERCESJ-1398. Fixing a usually slow growing memory leak. When a UTF-8, UTF-16, UCS-2 or UCS-4 byte sequence crosses a buffer boundary we call the read() method on the RewindableInputStream. This was always buffering the value returned from the underlying InputStream in the data array even when it will never be read again. For a well behaved InputStream if this occurred on every buffer of a 2 GB document we'd grow the data array to over 1 MB. A pathological InputStream which always returns only a few bytes at time could have caused the memory to be burned much quicker.
JIRA Issue #1398: https://issues.apache.org/jira/browse/XERCESJ-1398. Fixing a usually slow growing memory leak. When a UTF-8, UTF-16, UCS-2 or UCS-4 byte sequence crosses a buffer boundary we call the read() method on the RewindableInputStream. This was always buffering the value returned from the underlying InputStream in the data array even when it will never be read again. For a well behaved InputStream if this occurred on every buffer of a 2 GB document we'd grow the data array to over 1 MB. A pathological InputStream which always returns only a few bytes at time could have caused the memory to be burned much quicker.

git-svn-id: 39602be06c88ea89c23a8a9fd3d1314146990de6@944965 13f79535-47bb-0310-9956-ffa450edef68

RackerWilliams/xercesj,RackerWilliams/xercesj,RackerWilliams/xercesj