2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / class / Mainsoft.Web / Mainsoft.Web.SessionState / ObjectInputStream.cs
blobe6381005269d09ea778ffcf0ea8dafb16e8245fd
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:
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.
28 using System;
29 using java.io;
31 namespace Mainsoft.Web.SessionState
33 /// <summary>
34 /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
35 /// </summary>
36 public sealed partial class ServletSessionStateStoreProvider
38 sealed class ObjectInputStream : System.IO.Stream, ObjectInput
40 readonly ObjectInput _javaObjectInput;
42 public ObjectInputStream (ObjectInput stream) {
43 _javaObjectInput = stream;
46 public override bool CanRead {
47 get {
48 return true;
52 public override bool CanWrite {
53 get {
54 return false;
58 public override bool CanSeek {
59 get {
60 return true;
64 public override long Length {
65 get {
66 throw new NotSupportedException ();
70 public override long Position {
71 get {
72 throw new NotSupportedException ();
74 set {
75 throw new NotSupportedException ();
79 public override void Flush () {
80 throw new NotSupportedException ();
83 public override long Seek (long offset, System.IO.SeekOrigin origin) {
84 if (origin == System.IO.SeekOrigin.Current)
85 return _javaObjectInput.skip (offset);
87 throw new NotSupportedException ();
90 public override void SetLength (long value) {
91 throw new NotSupportedException ();
94 public override int Read (byte [] buffer, int offset, int count) {
95 int rv = _javaObjectInput.read (vmw.common.TypeUtils.ToSByteArray (buffer), offset, count);
96 return rv > 0 ? rv : 0;
99 public override void Write (byte [] buffer, int offset, int count) {
100 throw new NotSupportedException ();
103 public override int ReadByte () {
104 return _javaObjectInput.read ();
107 public override void Close () {
108 _javaObjectInput.close ();
111 #region ObjectInput Members
113 public int available () {
114 return _javaObjectInput.available ();
117 public void close () {
118 _javaObjectInput.close ();
121 public int read (sbyte [] __p1, int __p2, int __p3) {
122 return _javaObjectInput.read (__p1, __p2, __p3);
125 public int read (sbyte [] __p1) {
126 return _javaObjectInput.read (__p1);
129 public int read () {
130 return _javaObjectInput.read ();
133 public object readObject () {
134 return _javaObjectInput.readObject ();
137 public long skip (long __p1) {
138 return _javaObjectInput.skip (__p1);
141 #endregion
143 #region DataInput Members
145 public bool readBoolean () {
146 return _javaObjectInput.readBoolean ();
149 public sbyte readByte () {
150 return _javaObjectInput.readByte ();
153 public char readChar () {
154 return _javaObjectInput.readChar ();
157 public double readDouble () {
158 return _javaObjectInput.readDouble ();
161 public float readFloat () {
162 return _javaObjectInput.readFloat ();
165 public void readFully (sbyte [] __p1, int __p2, int __p3) {
166 _javaObjectInput.readFully (__p1, __p2, __p3);
169 public void readFully (sbyte [] __p1) {
170 _javaObjectInput.readFully (__p1);
173 public int readInt () {
174 return _javaObjectInput.readInt ();
177 public string readLine () {
178 return _javaObjectInput.readLine ();
181 public long readLong () {
182 return _javaObjectInput.readLong ();
185 public short readShort () {
186 return _javaObjectInput.readShort ();
189 public string readUTF () {
190 return _javaObjectInput.readUTF ();
193 public int readUnsignedByte () {
194 return _javaObjectInput.readUnsignedByte ();
197 public int readUnsignedShort () {
198 return _javaObjectInput.readUnsignedShort ();
201 public int skipBytes (int __p1) {
202 return _javaObjectInput.skipBytes (__p1);
205 #endregion