Beispiel #1
0
 public override void WriteByte(byte value)
 {
     if (GetType() != typeof(GZipStream))
     {
         // GZipStream is not sealed, and a derived type may have overridden Write(byte[], int, int) prior
         // to this WriteByte override being introduced.  In that case, this WriteByte override
         // should use the behavior of the Write(byte[],int,int) overload.
         base.WriteByte(value);
     }
     else
     {
         CheckDeflateStream();
         _deflateStream.WriteCore(MemoryMarshal.CreateReadOnlySpan(ref value, 1));
     }
 }
Beispiel #2
0
 public override void Write(ReadOnlySpan <byte> buffer)
 {
     if (GetType() != typeof(GZipStream))
     {
         // GZipStream is not sealed, and a derived type may have overridden Write(byte[], int, int) prior
         // to this Write(ReadOnlySpan<byte>) overload being introduced.  In that case, this Write(ReadOnlySpan<byte>) overload
         // should use the behavior of Write(byte[],int,int) overload.
         base.Write(buffer);
     }
     else
     {
         CheckDeflateStream();
         _deflateStream.WriteCore(buffer);
     }
 }