System.StreamExtensions.WriteNoAlloc C# (CSharp) Méthode

WriteNoAlloc() public static méthode

public static WriteNoAlloc ( this stream, byte bytes, int offset, int count ) : void
stream this
bytes byte
offset int
count int
Résultat void
        public static unsafe void WriteNoAlloc(this Stream stream, byte* bytes, int offset, int count)
        {
            var buffer = Buffer;
            int writtenCount = 0;
            int read = offset;
            int readEnd = offset + count;
            while (read != readEnd)
            {
                buffer[writtenCount++] = bytes[read++];
                if (writtenCount == buffer.Length)
                {
                    stream.Write(buffer, 0, writtenCount);
                    writtenCount = 0;
                }
            }

            if (writtenCount != 0)
                stream.Write(buffer, 0, writtenCount);
        }

Same methods

StreamExtensions::WriteNoAlloc ( this stream, Int16 v ) : void
StreamExtensions::WriteNoAlloc ( this stream, Int32 v ) : void
StreamExtensions::WriteNoAlloc ( this stream, System.Int64 v ) : void
StreamExtensions::WriteNoAlloc ( this stream, UInt16 v ) : void
StreamExtensions::WriteNoAlloc ( this stream, UInt32 v ) : void
StreamExtensions::WriteNoAlloc ( this stream, System.UInt64 v ) : void
StreamExtensions::WriteNoAlloc ( this stream, byte value ) : void
StreamExtensions::WriteNoAlloc ( this stream, decimal v ) : void
StreamExtensions::WriteNoAlloc ( this stream, double v ) : void
StreamExtensions::WriteNoAlloc ( this stream, float v ) : void
StreamExtensions::WriteNoAlloc ( this stream, string text, Encoding encoding = null ) : void