Exemple #1
0
        public void AddValue(string stringValue, int rank)
        {
            if (stringValue is null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.stringValue); }

            IByteBuffer buf = ArrayPooled.CopiedBuffer(stringValue, this.charset);
            this.value[rank] = buf;
            this.size += buf.ReadableBytes;
        }
Exemple #2
0
        public void SetValue(string stringValue, int rank)
        {
            if (stringValue is null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.stringValue); }

            IByteBuffer buf = ArrayPooled.CopiedBuffer(stringValue, this.charset);
            IByteBuffer old = this.value[rank];
            this.value[rank] = buf;
            if (old is object)
            {
                this.size -= old.ReadableBytes;
                _ = old.Release();
            }
            this.size += buf.ReadableBytes;
        }