You've already forked linux-packaging-mono
Imported Upstream version 5.16.0.100
Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
parent
0a9828183b
commit
7d7f676260
@@ -225,10 +225,26 @@ namespace System.IO {
|
||||
Contract.Requires(destination.CanWrite);
|
||||
Contract.Requires(bufferSize > 0);
|
||||
|
||||
#if MONO
|
||||
byte[] buffer = System.Buffers.ArrayPool<byte>.Shared.Rent(bufferSize);
|
||||
try
|
||||
{
|
||||
int read;
|
||||
while ((read = Read(buffer, 0, buffer.Length)) != 0)
|
||||
{
|
||||
destination.Write(buffer, 0, read);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.Buffers.ArrayPool<byte>.Shared.Return(buffer);
|
||||
}
|
||||
#else
|
||||
byte[] buffer = new byte[bufferSize];
|
||||
int read;
|
||||
while ((read = Read(buffer, 0, buffer.Length)) != 0)
|
||||
destination.Write(buffer, 0, read);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user