We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77438c6 commit d41cecaCopy full SHA for d41ceca
Library/DiscUtils.Streams/SubStream.cs
@@ -91,7 +91,16 @@ public override IEnumerable<StreamExtent> Extents
91
return _first + virtualPosition;
92
}
93
94
- public override long Length => _length;
+ /// <summary>
95
+ /// Current length of the stream. This may be less than the maximum length
96
+ /// if the underlying stream is shorter than the defined substream.
97
+ /// </summary>
98
+ public override long Length => Math.Min(_length, _parent.Length - _first);
99
+
100
101
+ /// Gets the maximum length allowed for the current stream.
102
103
+ public long MaximumLength => _length;
104
105
public override long Position { get; set; }
106
0 commit comments