blob: 5c94e476db24ca0dbff64cf9f0f83cde0504a572 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
//-----------------------------------------------------------------------
// <copyright file="IncomingWebResponseContract.cs" company="Outercurve Foundation">
// Copyright (c) Outercurve Foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.Messaging {
using System;
using System.Diagnostics.Contracts;
using System.IO;
/// <summary>
/// Code contract for the <see cref="IncomingWebResponse"/> class.
/// </summary>
[ContractClassFor(typeof(IncomingWebResponse))]
internal abstract class IncomingWebResponseContract : IncomingWebResponse {
/// <summary>
/// Gets the body of the HTTP response.
/// </summary>
/// <value></value>
public override Stream ResponseStream {
get { throw new NotImplementedException(); }
}
/// <summary>
/// Creates a text reader for the response stream.
/// </summary>
/// <returns>
/// The text reader, initialized for the proper encoding.
/// </returns>
public override StreamReader GetResponseReader() {
Contract.Ensures(Contract.Result<StreamReader>() != null);
throw new NotImplementedException();
}
/// <summary>
/// Gets an offline snapshot version of this instance.
/// </summary>
/// <param name="maximumBytesToCache">The maximum bytes from the response stream to cache.</param>
/// <returns>A snapshot version of this instance.</returns>
/// <remarks>
/// If this instance is a <see cref="NetworkDirectWebResponse"/> creating a snapshot
/// will automatically close and dispose of the underlying response stream.
/// If this instance is a <see cref="CachedDirectWebResponse"/>, the result will
/// be the self same instance.
/// </remarks>
internal override CachedDirectWebResponse GetSnapshot(int maximumBytesToCache) {
Requires.InRange(maximumBytesToCache >= 0, "maximumBytesToCache");
Requires.ValidState(this.RequestUri != null);
Contract.Ensures(Contract.Result<CachedDirectWebResponse>() != null);
throw new NotImplementedException();
}
}
}
|