Rename another Stream.Write(byte[]) extension method.

This commit is contained in:
Paul Chote
2018-03-07 20:27:22 +00:00
committed by abcdefg30
parent fadcfa0828
commit e69cf4fd5c
4 changed files with 39 additions and 44 deletions

View File

@@ -81,7 +81,7 @@ namespace OpenRA
public static void Write(this Stream s, int value)
{
s.Write(BitConverter.GetBytes(value));
s.WriteArray(BitConverter.GetBytes(value));
}
public static float ReadFloat(this Stream s)
@@ -131,7 +131,9 @@ namespace OpenRA
}
}
public static void Write(this Stream s, byte[] data)
// Note: renamed from Write() to avoid being aliased by
// System.IO.Stream.Write(System.ReadOnlySpan) (which is not implemented in Mono)
public static void WriteArray(this Stream s, byte[] data)
{
s.Write(data, 0, data.Length);
}
@@ -166,7 +168,7 @@ namespace OpenRA
bytes = new byte[0];
s.Write(bytes.Length);
s.Write(bytes);
s.WriteArray(bytes);
return 4 + bytes.Length;
}