LPS-49912 Refactor StreamUtil to provide more reliable io operations
LPS-49912 Apply to usage
LPS-49912 Update unit test