Rename the stream extension method WebUtil.CopyTo() to WebUtil.CopyStream().

.NET 4.0 added the method Stream.CopyTo(stream, bufferSize). For .NET 3.5
and before, WebUtil defined an extension method for Stream with the signature
Stream.CopyTo(stream, maxBytesToCopy). The meaning of the second parameter
is different in the two forms and depending on which compiler and/or
runtime you use, you could get one form or the other. Crashes ensue.
This change renames the WebUtil stream copy method to something that
cannot be confused with the new CopyTo method defined in .NET 4.0.
This commit is contained in:
Robert Adams
2012-03-12 10:07:04 -07:00
parent 1547fe959e
commit e0dd38f672
4 changed files with 9 additions and 4 deletions

View File

@@ -162,7 +162,7 @@ namespace OpenSim.Data.MySQL
using (GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data), CompressionMode.Decompress))
{
MemoryStream outputStream = new MemoryStream();
WebUtil.CopyTo(decompressionStream, outputStream, int.MaxValue);
WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
// int compressedLength = asset.Data.Length;
asset.Data = outputStream.ToArray();