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; }
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; }