1 |
|
/* |
2 |
|
* DotGNU ASP.GNU Implementation |
3 |
|
* |
4 |
|
* Copyright (C) 2003 DotGNU Project |
5 |
|
* |
6 |
|
* |
7 |
|
* This program is free software; you can redistribute it and/or modify |
8 |
|
* it under the terms of the GNU General Public License as published by |
9 |
|
* the Free Software Foundation; either version 2 of the License, or |
10 |
|
* (at your option) any later version. |
11 |
|
* |
12 |
|
* This program is distributed in the hope that it will be useful, |
13 |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
* GNU General Public License for more details. |
16 |
|
* |
17 |
|
* You should have received a copy of the GNU General Public License |
18 |
|
* along with this program; if not, write to the Free Software |
19 |
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
20 |
|
* |
21 |
|
* $Revision$ $Date$ |
22 |
|
* |
23 |
|
* -------------------------------------------------------------------------- |
24 |
|
* Authors: |
25 |
|
* Chris Smith |
26 |
|
*/ |
27 |
|
namespace System.Web |
28 |
|
{ |
29 |
|
using System; |
30 |
|
using System.IO; |
31 |
|
using System.Text; |
32 |
|
|
33 |
|
public class HttpResponse : IHttpResponse |
34 |
|
{ |
35 |
|
private Stream _oOutputStream; |
36 |
|
private String _oData; |
37 |
|
|
38 |
|
// DotGnu DGEE specific |
39 |
|
public HttpResponse( string response ) |
40 |
|
{ |
41 |
|
_oData = response; |
42 |
|
} |
43 |
|
|
44 |
|
public Stream OutputStream |
45 |
|
{ |
46 |
|
get { |
47 |
|
if( _oOutputStream == null ) |
48 |
|
{ |
49 |
|
_oOutputStream = new MemoryStream( _oData.Length ); |
50 |
|
|
51 |
|
StreamWriter sw = new StreamWriter( _oOutputStream, Encoding.ASCII ); |
52 |
|
sw.Write( _oData ); |
53 |
|
sw.Flush(); |
54 |
|
_oOutputStream.Seek(0, SeekOrigin.Begin ); |
55 |
|
} |
56 |
|
return _oOutputStream; |
57 |
|
} |
58 |
|
} |
59 |
|
|
60 |
|
// DotGnu DGEE specific |
61 |
|
public String Output |
62 |
|
{ |
63 |
|
get { |
64 |
|
return _oData; |
65 |
|
} |
66 |
|
set { |
67 |
|
_oData = value; |
68 |
|
} |
69 |
|
} |
70 |
|
} |
71 |
|
} |