Aegis.IO.StreamBuffer.Write C# (CSharp) Method

Write() public method

public Write ( byte source, int sourceIndex, int length ) : void
source byte
sourceIndex int
length int
return void
        public void Write(byte[] source, int sourceIndex, int length)
        {
            if (sourceIndex + length > source.Length)
                throw new AegisException(AegisResult.BufferUnderflow, "The source buffer is small then requested.");

            int copyBytes = length;
            if (WrittenBytes + copyBytes > BufferSize)
                Resize(BufferSize + copyBytes);

            Array.Copy(source, sourceIndex, Buffer, WrittenBytes, copyBytes);
            WrittenBytes += copyBytes;

            OnWritten();
        }

Same methods

StreamBuffer::Write ( StreamBuffer source ) : void
StreamBuffer::Write ( StreamBuffer source, int sourceIndex ) : void
StreamBuffer::Write ( StreamBuffer source, int sourceIndex, int length ) : void
StreamBuffer::Write ( byte source ) : void
StreamBuffer::Write ( byte source, int sourceIndex ) : void
StreamBuffer::Write ( char source ) : void
StreamBuffer::Write ( int size ) : void

Usage Example

Beispiel #1
0
        public static int PutDouble(StreamBuffer destination, double var)
        {
            int prevIndex = destination.WrittenBytes;

            destination.Write(BitConverter.GetBytes(var));
            return(prevIndex);
        }
All Usage Examples Of Aegis.IO.StreamBuffer::Write