2 // (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
5 // Vladimir Krasnov <vladimirk@mainsoft.com>
6 // Konstantin Triger <kostat@mainsoft.com>
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:
16 // The above copyright notice and this permission notice shall be
17 // included in all copies or substantial portions of the Software.
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.
31 namespace Mainsoft.Web.Hosting
33 public sealed class ObjectOutputStream : System.IO.Stream, ObjectOutput
35 readonly ObjectOutput _javaObjectOutput;
37 public ObjectOutputStream (ObjectOutput stream)
39 _javaObjectOutput = stream;
42 public override bool CanRead
50 public override bool CanSeek
58 public override bool CanWrite
66 public override void Close ()
68 _javaObjectOutput.close ();
71 public override void Flush ()
73 _javaObjectOutput.flush ();
76 public override long Length
80 throw new NotSupportedException ();
84 public override long Position
88 throw new NotSupportedException ();
92 throw new NotSupportedException ();
96 public override long Seek (long offset, System.IO.SeekOrigin origin)
98 throw new NotSupportedException ();
101 public override void SetLength (long value)
103 throw new NotSupportedException ();
106 public override int Read (byte [] buffer, int offset, int count)
108 throw new NotSupportedException ();
111 public override void Write (byte [] buffer, int offset, int count)
113 _javaObjectOutput.write (vmw.common.TypeUtils.ToSByteArray (buffer), offset, count);
116 public override void WriteByte (byte value)
118 _javaObjectOutput.write (value);
121 public ObjectOutput NativeStream
123 get { return _javaObjectOutput; }
126 #region ObjectOutput Members
130 _javaObjectOutput.close ();
135 _javaObjectOutput.flush ();
138 public void write (sbyte [] __p1, int __p2, int __p3)
140 _javaObjectOutput.write (__p1, __p2, __p3);
143 public void write (sbyte [] __p1)
145 _javaObjectOutput.write (__p1);
148 public void write (int __p1)
150 _javaObjectOutput.write (__p1);
153 public void writeObject (object __p1)
155 _javaObjectOutput.writeObject (__p1);
160 #region DataOutput Members
163 public void writeBoolean (bool __p1)
165 _javaObjectOutput.writeBoolean (__p1);
168 public void writeByte (int __p1)
170 _javaObjectOutput.writeByte (__p1);
173 public void writeBytes (string __p1)
175 _javaObjectOutput.writeBytes (__p1);
178 public void writeChar (int __p1)
180 _javaObjectOutput.writeChar (__p1);
183 public void writeChars (string __p1)
185 _javaObjectOutput.writeChars (__p1);
188 public void writeDouble (double __p1)
190 _javaObjectOutput.writeDouble (__p1);
193 public void writeFloat (float __p1)
195 _javaObjectOutput.writeFloat (__p1);
198 public void writeInt (int __p1)
200 _javaObjectOutput.writeInt (__p1);
203 public void writeLong (long __p1)
205 _javaObjectOutput.writeLong (__p1);
208 public void writeShort (int __p1)
210 _javaObjectOutput.writeShort (__p1);
213 public void writeUTF (string __p1)
215 _javaObjectOutput.writeUTF (__p1);