reworked retrieving of inputstream - first try error stream and if not available try with input stream
Merge pull request #215 from masconsult/master

refactored retrieving of inputstream