コード例 #1
0
ファイル: ReadableBuffer.cs プロジェクト: yyjdelete/SpanNetty
        public static ReadableBuffer Composite(IEnumerable <ReadableBuffer> buffers)
        {
            if (buffers is null)
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.buffers);
            }

            CompositeByteBuffer composite = Unpooled.CompositeBuffer();

            foreach (ReadableBuffer buf in buffers)
            {
                IByteBuffer byteBuffer = buf._buffer;
                if (byteBuffer.IsReadable())
                {
                    composite.AddComponent(byteBuffer);
                }
            }

            return(new ReadableBuffer(composite));
        }
コード例 #2
0
 public override CompositeByteBuffer AddComponent(IByteBuffer buffer)
 {
     _ = _wrapped.AddComponent(buffer);
     return(this);
 }