I have a small question. What return common binary reading methods on the end of stream? For example I have Stream.ReadByte() which returns single unsigned byte. What happens when I’m on the end of stream? And is there any difference when I’m using this method with NetworkStream? Please help.
I have a small question. What return common binary reading methods on the end
Share
According to the documentation for the base class:
So, the method reads an int and casts it to a wider type, in order to be able to return additional -1 value at the end of the stream.
Both
FileStreamandNetworkStreamare derived fromStream. This means that no difference in the logic is needed.