FillWith() 공개 메소드

Copies data from a byte array into the buffer.
The length of the sourceArray must be less than or equal to the buffer size.
public FillWith ( byte sourceArray ) : void
sourceArray byte The one-dimensional byte array that contains the data.
리턴 void
예제 #1
0
        /// <summary>
        /// Helper method that gets a filled buffer constructed from a list of memory blocks
        /// </summary>
        /// <param name="allocatedBlocks">The memoryblocks that comprise the buffer</param>
        /// <param name="filledWith">If not null, the contents the memory block will be filled with</param>
        /// <returns>An optionally filled IBuffer object</returns>
        private static IBuffer GetFilledBuffer(IList <IMemoryBlock> allocatedBlocks, byte[] filledWith)
        {
            IBuffer newBuffer = new ManagedBuffer(allocatedBlocks);

            if (filledWith != null)
            {
                newBuffer.FillWith(filledWith);
            }
            return(newBuffer);
        }
예제 #2
0
 /// <summary>
 /// Helper method that gets a filled buffer constructed from a list of memory blocks
 /// </summary>
 /// <param name="allocatedBlocks">The memoryblocks that comprise the buffer</param>
 /// <param name="filledWith">If not null, the contents the memory block will be filled with</param>
 /// <returns>An optionally filled IBuffer object</returns>
 private static IBuffer GetFilledBuffer(IList<IMemoryBlock> allocatedBlocks, byte[] filledWith)
 {
     IBuffer newBuffer = new ManagedBuffer(allocatedBlocks);
     if (filledWith != null) newBuffer.FillWith(filledWith);
     return newBuffer;
 }