Added new test to shape the changes in obtainEncodingStringFromInputStream(...) then made the changes. All tests pass locally, I still expect one to fail on travis-ci.
Improved the JavaDoc and the comments for the recently changed methods.'