Skip to content
This repository was archived by the owner on Jan 24, 2021. It is now read-only.

Commit 53b5f3f

Browse files
author
Adam Hathcock
committed
Allow seekable methods to be used and let the current underlying stream manage that.
1 parent 1993a13 commit 53b5f3f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Nancy/IO/RequestStream.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ public override bool CanRead
123123
/// <summary>
124124
/// Gets a value indicating whether the current stream supports seeking.
125125
/// </summary>
126-
/// <returns>Always returns <see langword="false"/>.</returns>
126+
/// <returns>Returns depending on whether the stream is buffered or not.</returns>
127127
public override bool CanSeek
128128
{
129-
get { return false; }
129+
get { return this.stream.CanSeek; }
130130
}
131131

132132
/// <summary>
@@ -312,7 +312,7 @@ public override int ReadByte()
312312
/// <param name="origin">A value of type <see cref="T:System.IO.SeekOrigin"/> indicating the reference point used to obtain the new position. </param>
313313
public override long Seek(long offset, SeekOrigin origin)
314314
{
315-
throw new NotSupportedException();
315+
return this.stream.Seek(offset, origin);
316316
}
317317

318318
/// <summary>
@@ -323,7 +323,7 @@ public override long Seek(long offset, SeekOrigin origin)
323323
/// <remarks>This functionality is not supported by the <see cref="RequestStream"/> type and will always throw <see cref="NotSupportedException"/>.</remarks>
324324
public override void SetLength(long value)
325325
{
326-
throw new NotSupportedException();
326+
this.stream.SetLength(value);
327327
}
328328

329329
/// <summary>

0 commit comments

Comments
 (0)