You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/System/IO/StreamFile.cs
+34-2Lines changed: 34 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
namespaceOwlCore.Storage.System.IO;
8
8
9
9
/// <summary>
10
-
/// A file implementation which holds a reference to the provided <see cref="Stream"/> and returns it in a non-disposable wrapper for <see cref="OpenStreamAsync"/>.
10
+
/// A file implementation which holds a reference to the provided <see cref="Stream"/> and returns it either wrapped in a non-disposable wrapper or directly, based on the <see cref="ShouldDispose"/> property.
11
11
/// </summary>
12
12
publicclassStreamFile:IFile
13
13
{
@@ -16,12 +16,28 @@ public class StreamFile : IFile
16
16
/// </summary>
17
17
publicStreamStream{get;}
18
18
19
+
/// <summary>
20
+
/// Gets a value indicating whether the underlying stream should be disposed when the returned stream from <see cref="OpenStreamAsync"/> is disposed.
21
+
/// When true, the underlying stream is returned directly. When false, the stream is wrapped in a non-disposable wrapper.
22
+
/// </summary>
23
+
publicboolShouldDispose{get;}
24
+
19
25
/// <summary>
20
26
/// Creates a new instance of <see cref="StreamFile"/>.
21
27
/// </summary>
22
28
/// <param name="stream">An existing stream which is provided as the file contents.</param>
/// Creates a new instance of <see cref="StreamFile"/>.
36
+
/// </summary>
37
+
/// <param name="stream">An existing stream which is provided as the file contents.</param>
38
+
/// <param name="shouldDispose">When true, the underlying stream will be disposed when the returned stream from <see cref="OpenStreamAsync"/> is disposed. When false, the stream is wrapped in a non-disposable wrapper.</param>
/// Creates a new instance of <see cref="StreamFile"/>.
57
+
/// </summary>
58
+
/// <param name="stream">An existing stream which is provided as the file contents.</param>
59
+
/// <param name="id">A unique and consistent identifier for this file or folder.</param>
60
+
/// <param name="name">The name of the file or folder, with the extension (if any).</param>
61
+
/// <param name="shouldDispose">When true, the underlying stream will be disposed when the returned stream from <see cref="OpenStreamAsync"/> is disposed. When false, the stream is wrapped in a non-disposable wrapper.</param>
0 commit comments