Skip to content

Commit ff97a01

Browse files
authored
Update README.md
1 parent d387f21 commit ff97a01

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,3 +895,28 @@ Setting the `Invert.ValueInverter` property (similar to `Binding.Converter`) all
895895
<ComboBox ItemsSource="{Enum EnumType={x:Static MyEnum}}"/>
896896

897897
```
898+
899+
---
900+
901+
### AutoResetStream
902+
A `Stream` decorator that resets the stream's position after red(write access
903+
904+
#### Example
905+
906+
```C#
907+
using (var fileStream = new FileStream("C:/Temp", FileMode.CreateNew))
908+
{
909+
bool leaveFileStreamOpen = true;
910+
911+
using (var autoResetStream = new AutoResetStream(fileStream, leaveFileStreamOpen))
912+
{
913+
byte[] buffer = new byte[1024];
914+
int bytesRead = await autoResetStream.ReadAsync(buffer, 0, buffer.Length);
915+
int currentPosition = autoResetStream.Position; // retuns: 0
916+
}
917+
918+
currentPosition = fileStream.Position; // retuns: 0
919+
}
920+
921+
```
922+
---

0 commit comments

Comments
 (0)