2004-03-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web.UI / LosFormatter.cs
1 //
2 // System.Web.UI.LosFormatter
3 //
4 // Authors:
5 //      Ben Maurer (bmaurer@users.sourceforge.net)
6 //
7 // (C) 2003 Ben Maurer
8 //
9
10 using System.IO;
11
12
13 namespace System.Web.UI {
14         public sealed class LosFormatter {
15
16                 ObjectStateFormatter osf = new ObjectStateFormatter ();
17                 
18                 public LosFormatter ()
19                 {
20                 }
21
22 #if NET_1_1
23                 [MonoTODO]
24                 public LosFormatter (bool enableMac, string macKeyModifier)
25                 {
26                 }
27 #endif  
28                 public object Deserialize (Stream stream)
29                 {
30                         return osf.Deserialize (stream);
31                 }
32
33                 public object Deserialize (TextReader input)
34                 {
35                         if (input == null)
36                                 throw new ArgumentNullException ("input");
37
38                         return Deserialize (input.ReadToEnd ());
39                 }
40
41                 public object Deserialize (string input)
42                 {
43                         return osf.Deserialize (input);
44                 }
45
46                 public void Serialize (Stream stream, object value)
47                 {
48                         osf.Serialize (stream, value);
49                 }
50
51                 public void Serialize (TextWriter output, object value)
52                 {
53                         if (output == null)
54                                 throw new ArgumentNullException ("output");
55                         
56                         output.Write (osf.Serialize (value));
57                 }       
58         }
59 }