SceneGate / Yarhl

Framework for the implementation of format converters like game assets or media files
https://scenegate.github.io/Yarhl/
MIT License
60 stars 10 forks source link

Use DataStream type in Stream properties for readers and writers and explicitly set CanTimeout to false #172

Closed pleonex closed 2 years ago

pleonex commented 2 years ago

Description

Get again all the advantages of DataStream from the properties of DataReader, DataWriter, TextDataReader and TextDataWriter. This reduces the amount of breaking changes introduced by this release.

Also set CanTimeout to false and return invalid values for ReadTimeout and WriterTimeout. The default implementation is to throw an exception and that make almost impossible to use some reflection in the type. For instance in debuggers or in UI controls that display automatically the value of the properties.

Example

using var stream = new DataStream();
var reader = new DataReader(stream);
reader.Stream.PushPosition();