2004-02-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web / HttpResponseStreamProxy.cs
1 // 
2 // System.Web.HttpResponseStreamProxy
3 //
4 // Authors:
5 //      Patrik Torstensson (Patrik.Torstensson@labs2.com)
6 //
7 using System;
8 using System.IO;
9
10 namespace System.Web
11 {
12         class HttpResponseStreamProxy : HttpResponseStream
13         {
14                 bool filteringActive;
15
16                 internal HttpResponseStreamProxy (HttpWriter writer) : base (writer)
17                 {
18                 }
19
20                 internal void CheckFilteringState ()
21                 {
22                         if (!filteringActive)
23                                 throw new HttpException ("Invalid response filter state");
24                 }
25
26                 internal bool Active {
27                         get { return filteringActive; }
28                         set { filteringActive = value; }
29                 }
30
31                 public override void Flush ()
32                 {
33                 }
34
35                 public override void Close ()
36                 {
37                 }
38
39                 public override void Write (byte [] buffer, int offset, int length)
40                 {
41                         CheckFilteringState ();
42                         base.Write (buffer, offset, length);
43                 }
44         }
45 }
46