* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.Web / System.Web.J2EE / ObjectOutputStream.cs
1 //
2 // (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
3 //
4 // Authors:
5 //      Vladimir Krasnov <vladimirk@mainsoft.com>
6 //      Konstantin Triger <kostat@mainsoft.com>
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining
9 // a copy of this software and associated documentation files (the
10 // "Software"), to deal in the Software without restriction, including
11 // without limitation the rights to use, copy, modify, merge, publish,
12 // distribute, sublicense, and/or sell copies of the Software, and to
13 // permit persons to whom the Software is furnished to do so, subject to
14 // the following conditions:
15 //
16 // The above copyright notice and this permission notice shall be
17 // included in all copies or substantial portions of the Software.
18 //
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 //\r
27 \r
28 using System;\r
29 \r
30 namespace System.Web.J2EE\r
31 {\r
32         internal class ObjectOutputStream : System.IO.Stream {\r
33                 readonly java.io.ObjectOutput _javaObjectOutput;\r
34 \r
35                 public ObjectOutputStream(java.io.ObjectOutput stream) {\r
36                         _javaObjectOutput = stream;\r
37                 }\r
38 \r
39                 public override bool CanRead {\r
40                         get {\r
41                                 return false;\r
42                         }\r
43                 }\r
44 \r
45                 public override bool CanSeek {\r
46                         get {\r
47                                 return false;\r
48                         }\r
49                 }\r
50 \r
51                 public override bool CanWrite {\r
52                         get {\r
53                                 return true;\r
54                         }\r
55                 }\r
56 \r
57                 public override void Close() {\r
58                         _javaObjectOutput.close();\r
59                 }\r
60 \r
61                 public override void Flush() {\r
62                         _javaObjectOutput.flush();\r
63                 }\r
64 \r
65                 public override long Length {\r
66                         get {\r
67                                 throw new NotSupportedException();\r
68                         }\r
69                 }\r
70 \r
71                 public override long Position {\r
72                         get {\r
73                                 throw new NotSupportedException();\r
74                         }\r
75                         set {\r
76                                 throw new NotSupportedException();\r
77                         }\r
78                 }\r
79 \r
80                 public override long Seek(long offset, System.IO.SeekOrigin origin) {\r
81                         throw new NotSupportedException();\r
82                 }\r
83 \r
84                 public override void SetLength(long value) {\r
85                         throw new NotSupportedException();\r
86                 }\r
87 \r
88                 public override int Read(byte[] buffer, int offset, int count) {\r
89                         throw new NotSupportedException();\r
90                 }\r
91 \r
92                 public override void Write(byte[] buffer, int offset, int count) {\r
93                         _javaObjectOutput.write( vmw.common.TypeUtils.ToSByteArray(buffer), offset, count );\r
94                 }\r
95 \r
96                 public override void WriteByte(byte value) {\r
97                         _javaObjectOutput.write(value);\r
98                 }\r
99 \r
100                 public java.io.ObjectOutput NativeStream {\r
101                         get {return _javaObjectOutput;}\r
102                 }\r
103         }\r
104 }\r