Added optional encoding parameter, unit tests for byteStreamToString()