projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Jumbo patch for NET_2_0, mscorlib is now clean
[mono.git]
/
mcs
/
class
/
corlib
/
System.IO
/
Stream.cs
diff --git
a/mcs/class/corlib/System.IO/Stream.cs
b/mcs/class/corlib/System.IO/Stream.cs
index 6c1fa4c01800f4c00cdd275e4e42e653eb4faa8d..d6e0359a86713b8a913ee9e47ef0c26ca95d9569 100644
(file)
--- a/
mcs/class/corlib/System.IO/Stream.cs
+++ b/
mcs/class/corlib/System.IO/Stream.cs
@@
-1,5
+1,5
@@
//
//
-// System.IO
/
Stream.cs
+// System.IO
.
Stream.cs
//
// Authors:
// Dietmar Maurer (dietmar@ximian.com)
//
// Authors:
// Dietmar Maurer (dietmar@ximian.com)
@@
-40,7
+40,12
@@
using System.Runtime.InteropServices;
namespace System.IO
{
[Serializable]
namespace System.IO
{
[Serializable]
+ [ComVisible (true)]
+#if NET_2_1
+ public abstract class Stream : IDisposable
+#else
public abstract class Stream : MarshalByRefObject, IDisposable
public abstract class Stream : MarshalByRefObject, IDisposable
+#endif
{
public static readonly Stream Null = new NullStream ();
{
public static readonly Stream Null = new NullStream ();
@@
-63,13
+68,12
@@
namespace System.IO
get;
}
get;
}
-#if NET_2_0
+ [ComVisible (false)]
public virtual bool CanTimeout {
get {
return false;
}
}
public virtual bool CanTimeout {
get {
return false;
}
}
-#endif
public abstract long Length
{
public abstract long Length
{
@@
-83,7
+87,6
@@
namespace System.IO
}
}
-#if NET_2_0
// 2.0 version of Dispose.
public void Dispose ()
{
// 2.0 version of Dispose.
public void Dispose ()
{
@@
-104,6
+107,7
@@
namespace System.IO
Dispose (true);
}
Dispose (true);
}
+ [ComVisible (false)]
public virtual int ReadTimeout {
get {
throw new InvalidOperationException ("Timeouts are not supported on this stream.");
public virtual int ReadTimeout {
get {
throw new InvalidOperationException ("Timeouts are not supported on this stream.");
@@
-113,6
+117,7
@@
namespace System.IO
}
}
}
}
+ [ComVisible (false)]
public virtual int WriteTimeout {
get {
throw new InvalidOperationException ("Timeouts are not supported on this stream.");
public virtual int WriteTimeout {
get {
throw new InvalidOperationException ("Timeouts are not supported on this stream.");
@@
-121,19
+126,13
@@
namespace System.IO
throw new InvalidOperationException ("Timeouts are not supported on this stream.");
}
}
throw new InvalidOperationException ("Timeouts are not supported on this stream.");
}
}
-#else
- // 1.1 version of Close
- public virtual void Close ()
- {
- // nothing
- }
-#endif
- void IDisposable.Dispose ()
+ public static Stream Synchronized (Stream stream)
{
{
-
Close
();
+
throw new NotImplementedException
();
}
}
+ [Obsolete ("CreateWaitHandle is due for removal. Use \"new ManualResetEvent(false)\" instead.")]
protected virtual WaitHandle CreateWaitHandle()
{
return new ManualResetEvent (false);
protected virtual WaitHandle CreateWaitHandle()
{
return new ManualResetEvent (false);
@@
-169,7
+168,7
@@
namespace System.IO
}
public virtual IAsyncResult
}
public virtual IAsyncResult
- BeginRead (byte [] buffer, int offset, int count, AsyncCallback cback, object state)
+ BeginRead (byte [] buffer, int offset, int count, AsyncCallback c
all
back, object state)
{
if (!CanRead)
throw new NotSupportedException ("This stream does not support reading");
{
if (!CanRead)
throw new NotSupportedException ("This stream does not support reading");
@@
-190,16
+189,16
@@
namespace System.IO
result.SetComplete (e, 0);
}
result.SetComplete (e, 0);
}
- if (cback != null)
- cback (result);
+ if (c
all
back != null)
+ c
all
back (result);
return result;
}
return result;
}
-
delegate void WriteDelegate (byte [] buffer, int offset, int count);
+
//
delegate void WriteDelegate (byte [] buffer, int offset, int count);
public virtual IAsyncResult
public virtual IAsyncResult
- BeginWrite (byte [] buffer, int offset, int count, AsyncCallback cback, object state)
+ BeginWrite (byte [] buffer, int offset, int count, AsyncCallback c
all
back, object state)
{
if (!CanWrite)
throw new NotSupportedException ("This stream does not support writing");
{
if (!CanWrite)
throw new NotSupportedException ("This stream does not support writing");
@@
-220,20
+219,20
@@
namespace System.IO
result.SetComplete (e);
}
result.SetComplete (e);
}
- if (cback != null)
- cback.BeginInvoke (result, null, null);
+ if (c
all
back != null)
+ c
all
back.BeginInvoke (result, null, null);
return result;
}
return result;
}
- public virtual int EndRead (IAsyncResult async
_r
esult)
+ public virtual int EndRead (IAsyncResult async
R
esult)
{
{
- if (async
_r
esult == null)
- throw new ArgumentNullException ("async
_r
esult");
+ if (async
R
esult == null)
+ throw new ArgumentNullException ("async
R
esult");
- StreamAsyncResult result = async
_r
esult as StreamAsyncResult;
+ StreamAsyncResult result = async
R
esult as StreamAsyncResult;
if (result == null || result.NBytes == -1)
if (result == null || result.NBytes == -1)
- throw new ArgumentException ("Invalid IAsyncResult", "async
_r
esult");
+ throw new ArgumentException ("Invalid IAsyncResult", "async
R
esult");
if (result.Done)
throw new InvalidOperationException ("EndRead already called.");
if (result.Done)
throw new InvalidOperationException ("EndRead already called.");
@@
-245,14
+244,14
@@
namespace System.IO
return result.NBytes;
}
return result.NBytes;
}
- public virtual void EndWrite (IAsyncResult async
_r
esult)
+ public virtual void EndWrite (IAsyncResult async
R
esult)
{
{
- if (async
_r
esult == null)
- throw new ArgumentNullException ("async
_r
esult");
+ if (async
R
esult == null)
+ throw new ArgumentNullException ("async
R
esult");
- StreamAsyncResult result = async
_r
esult as StreamAsyncResult;
+ StreamAsyncResult result = async
R
esult as StreamAsyncResult;
if (result == null || result.NBytes != -1)
if (result == null || result.NBytes != -1)
- throw new ArgumentException ("Invalid IAsyncResult", "async
_r
esult");
+ throw new ArgumentException ("Invalid IAsyncResult", "async
R
esult");
if (result.Done)
throw new InvalidOperationException ("EndWrite already called.");
if (result.Done)
throw new InvalidOperationException ("EndWrite already called.");
@@
-306,9
+305,7
@@
namespace System.IO
{
}
{
}
- public override int Read (byte[] buffer,
- int offset,
- int count)
+ public override int Read (byte[] buffer, int offset, int count)
{
return 0;
}
{
return 0;
}
@@
-318,8
+315,7
@@
namespace System.IO
return -1;
}
return -1;
}
- public override long Seek (long offset,
- SeekOrigin origin)
+ public override long Seek (long offset, SeekOrigin origin)
{
return 0;
}
{
return 0;
}
@@
-328,9
+324,7
@@
namespace System.IO
{
}
{
}
- public override void Write (byte[] buffer,
- int offset,
- int count)
+ public override void Write (byte[] buffer, int offset, int count)
{
}
{
}