CK.Core.CKBinaryWriter.WriteNonNegativeSmallInt32 C# (CSharp) Method

WriteNonNegativeSmallInt32() public method

Writes a 32-bit 0 or positive integer in compressed format. See remarks.
Using this method to write a negative integer is the same as using ot with a large positive number: the storage will actually require more than 4 bytes. It is perfectly valid, except that it is more "expansion" than "compression" :).
public WriteNonNegativeSmallInt32 ( int value ) : void
value int A 32-bit integer (should not be negative).
return void
        public void WriteNonNegativeSmallInt32( int value ) => Write7BitEncodedInt( value );

Usage Example

Example #1
0
        void WriteWithoutVersion(CKBinaryWriter w)
        {
            if (w == null)
            {
                throw new ArgumentNullException("w");
            }
            w.Write(_message);
            w.Write(_exceptionTypeName);
            w.Write(_exceptionTypeAQName);
            w.WriteNullableString(_stackTrace);
            w.WriteNullableString(_fileName);
            w.WriteNullableString(_detailedInfo);

            if (_aggregatedExceptions != null)
            {
                w.WriteSmallInt32(_aggregatedExceptions.Length);
                foreach (var agg in _aggregatedExceptions)
                {
                    agg.WriteWithoutVersion(w);
                }
            }
            else
            {
                if (_innerException != null)
                {
                    w.WriteSmallInt32(0);
                    _innerException.WriteWithoutVersion(w);
                }
                else
                {
                    w.WriteSmallInt32(-1);
                }
            }

            if (_loaderExceptions != null)
            {
                w.WriteNonNegativeSmallInt32(_loaderExceptions.Length);
                foreach (var ld in _loaderExceptions)
                {
                    ld.WriteWithoutVersion(w);
                }
            }
            else
            {
                w.WriteNonNegativeSmallInt32(0);
            }
        }
All Usage Examples Of CK.Core.CKBinaryWriter::WriteNonNegativeSmallInt32