Skip to content

Commit 372aec6

Browse files
committed
Remove unused WriteStreamRaw
1 parent cf6b67a commit 372aec6

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

src/Npgsql/Internal/NpgsqlWriteBuffer.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -422,30 +422,6 @@ static async Task WriteBytesLong(NpgsqlWriteBuffer buffer, bool async, ReadOnlyM
422422
}
423423
}
424424

425-
public async Task WriteStreamRaw(Stream stream, int count, bool async, CancellationToken cancellationToken = default)
426-
{
427-
while (count > 0)
428-
{
429-
if (WriteSpaceLeft == 0)
430-
await Flush(async, cancellationToken).ConfigureAwait(false);
431-
try
432-
{
433-
var read = async
434-
? await stream.ReadAsync(Buffer, WritePosition, Math.Min(WriteSpaceLeft, count), cancellationToken).ConfigureAwait(false)
435-
: stream.Read(Buffer, WritePosition, Math.Min(WriteSpaceLeft, count));
436-
if (read == 0)
437-
throw new EndOfStreamException();
438-
WritePosition += read;
439-
count -= read;
440-
}
441-
catch (Exception e)
442-
{
443-
throw Connector.Break(new NpgsqlException("Exception while writing to stream", e));
444-
}
445-
}
446-
Debug.Assert(count == 0);
447-
}
448-
449425
public void WriteNullTerminatedString(string s)
450426
{
451427
AssertASCIIOnly(s);

0 commit comments

Comments
 (0)