Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@ -193,8 +193,8 @@ namespace System.IO.Compression
}
}
public override IAsyncResult BeginRead (byte [] buffer, int offset, int count,
AsyncCallback cback, object state)
public override IAsyncResult BeginRead (byte [] array, int offset, int count,
AsyncCallback asyncCallback, object asyncState)
{
if (disposed)
throw new ObjectDisposedException (GetType ().FullName);
@ -202,8 +202,8 @@ namespace System.IO.Compression
if (!CanRead)
throw new NotSupportedException ("This stream does not support reading");
if (buffer == null)
throw new ArgumentNullException ("buffer");
if (array == null)
throw new ArgumentNullException ("array");
if (count < 0)
throw new ArgumentOutOfRangeException ("count", "Must be >= 0");
@ -211,15 +211,15 @@ namespace System.IO.Compression
if (offset < 0)
throw new ArgumentOutOfRangeException ("offset", "Must be >= 0");
if (count + offset > buffer.Length)
if (count + offset > array.Length)
throw new ArgumentException ("Buffer too small. count/offset wrong.");
ReadMethod r = new ReadMethod (ReadInternal);
return r.BeginInvoke (buffer, offset, count, cback, state);
return r.BeginInvoke (array, offset, count, asyncCallback, asyncState);
}
public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count,
AsyncCallback cback, object state)
public override IAsyncResult BeginWrite (byte [] array, int offset, int count,
AsyncCallback asyncCallback, object asyncState)
{
if (disposed)
throw new ObjectDisposedException (GetType ().FullName);
@ -227,8 +227,8 @@ namespace System.IO.Compression
if (!CanWrite)
throw new InvalidOperationException ("This stream does not support writing");
if (buffer == null)
throw new ArgumentNullException ("buffer");
if (array == null)
throw new ArgumentNullException ("array");
if (count < 0)
throw new ArgumentOutOfRangeException ("count", "Must be >= 0");
@ -236,43 +236,43 @@ namespace System.IO.Compression
if (offset < 0)
throw new ArgumentOutOfRangeException ("offset", "Must be >= 0");
if (count + offset > buffer.Length)
if (count + offset > array.Length)
throw new ArgumentException ("Buffer too small. count/offset wrong.");
WriteMethod w = new WriteMethod (WriteInternal);
return w.BeginInvoke (buffer, offset, count, cback, state);
return w.BeginInvoke (array, offset, count, asyncCallback, asyncState);
}
public override int EndRead(IAsyncResult async_result)
public override int EndRead(IAsyncResult asyncResult)
{
if (async_result == null)
throw new ArgumentNullException ("async_result");
if (asyncResult == null)
throw new ArgumentNullException ("asyncResult");
AsyncResult ares = async_result as AsyncResult;
AsyncResult ares = asyncResult as AsyncResult;
if (ares == null)
throw new ArgumentException ("Invalid IAsyncResult", "async_result");
throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
ReadMethod r = ares.AsyncDelegate as ReadMethod;
if (r == null)
throw new ArgumentException ("Invalid IAsyncResult", "async_result");
throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
return r.EndInvoke (async_result);
return r.EndInvoke (asyncResult);
}
public override void EndWrite (IAsyncResult async_result)
public override void EndWrite (IAsyncResult asyncResult)
{
if (async_result == null)
throw new ArgumentNullException ("async_result");
if (asyncResult == null)
throw new ArgumentNullException ("asyncResult");
AsyncResult ares = async_result as AsyncResult;
AsyncResult ares = asyncResult as AsyncResult;
if (ares == null)
throw new ArgumentException ("Invalid IAsyncResult", "async_result");
throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
WriteMethod w = ares.AsyncDelegate as WriteMethod;
if (w == null)
throw new ArgumentException ("Invalid IAsyncResult", "async_result");
throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
w.EndInvoke (async_result);
w.EndInvoke (asyncResult);
return;
}
@ -486,6 +486,7 @@ namespace System.IO.Compression
const string LIBNAME = "MonoPosixHelper";
#endif
#if !ORBIS
[DllImport (LIBNAME, CallingConvention=CallingConvention.Cdecl)]
static extern IntPtr CreateZStream (CompressionMode compress, bool gzip, UnmanagedReadOrWrite feeder, IntPtr data);
@ -500,6 +501,33 @@ namespace System.IO.Compression
[DllImport (LIBNAME, CallingConvention=CallingConvention.Cdecl)]
static extern int WriteZStream (IntPtr stream, IntPtr buffer, int length);
#else
static IntPtr CreateZStream (CompressionMode compress, bool gzip, UnmanagedReadOrWrite feeder, IntPtr data)
{
throw new PlatformNotSupportedException ();
}
static int CloseZStream (IntPtr stream)
{
throw new PlatformNotSupportedException ();
}
static int Flush (IntPtr stream)
{
throw new PlatformNotSupportedException ();
}
static int ReadZStream (IntPtr stream, IntPtr buffer, int length)
{
throw new PlatformNotSupportedException ();
}
static int WriteZStream (IntPtr stream, IntPtr buffer, int length)
{
throw new PlatformNotSupportedException ();
}
#endif
}
}