Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ecc439e

Browse files
stephentoubsafern
authored andcommitted
Fix BinaryWriter/Reader span parameter names (dotnet/coreclr#14577)
Per API review, they should match the corresponding overloads' existing parameter names. Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
1 parent 99037c8 commit ecc439e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Common/src/CoreLib/System/IO/BinaryWriter.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,33 +390,33 @@ public unsafe virtual void Write(String value)
390390
}
391391
}
392392

393-
public virtual void Write(ReadOnlySpan<byte> value)
393+
public virtual void Write(ReadOnlySpan<byte> buffer)
394394
{
395395
if (GetType() == typeof(BinaryWriter))
396396
{
397-
OutStream.Write(value);
397+
OutStream.Write(buffer);
398398
}
399399
else
400400
{
401-
byte[] buffer = ArrayPool<byte>.Shared.Rent(value.Length);
401+
byte[] array = ArrayPool<byte>.Shared.Rent(buffer.Length);
402402
try
403403
{
404-
value.CopyTo(buffer);
405-
Write(buffer, 0, value.Length);
404+
buffer.CopyTo(array);
405+
Write(array, 0, buffer.Length);
406406
}
407407
finally
408408
{
409-
ArrayPool<byte>.Shared.Return(buffer);
409+
ArrayPool<byte>.Shared.Return(array);
410410
}
411411
}
412412
}
413413

414-
public virtual void Write(ReadOnlySpan<char> value)
414+
public virtual void Write(ReadOnlySpan<char> chars)
415415
{
416-
byte[] bytes = ArrayPool<byte>.Shared.Rent(_encoding.GetMaxByteCount(value.Length));
416+
byte[] bytes = ArrayPool<byte>.Shared.Rent(_encoding.GetMaxByteCount(chars.Length));
417417
try
418418
{
419-
int bytesWritten = _encoding.GetBytes(value, bytes);
419+
int bytesWritten = _encoding.GetBytes(chars, bytes);
420420
Write(bytes, 0, bytesWritten);
421421
}
422422
finally

0 commit comments

Comments
 (0)