Skip to content

Commit 10a24f3

Browse files
EgorBomarek-safar
authored andcommitted
Implement WriteCore and ReadCore in DeflateStream
1 parent a925846 commit 10a24f3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mcs/class/System/System.IO.Compression/DeflateStream.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ internal ValueTask<int> ReadAsyncMemory (Memory<byte> destination, CancellationT
145145

146146
internal int ReadCore (Span<byte> destination)
147147
{
148-
throw new NotImplementedException ();
148+
var buffer = new byte [destination.Length];
149+
int count = Read(buffer, 0, buffer.Length);
150+
buffer.AsSpan(0, count).CopyTo(destination);
151+
return count;
149152
}
150153

151154
public override int Read (byte[] array, int offset, int count)
@@ -185,7 +188,7 @@ internal ValueTask WriteAsyncMemory (ReadOnlyMemory<byte> source, CancellationTo
185188

186189
internal void WriteCore (ReadOnlySpan<byte> source)
187190
{
188-
throw new NotImplementedException ();
191+
Write (source.ToArray (), 0, source.Length);
189192
}
190193

191194
public override void Write (byte[] array, int offset, int count)

0 commit comments

Comments
 (0)