Update StreamResourceUtility.cs

add checking of Read() return value. without this using of non-initialized (0) value or value from the previous step of loop.