NewIsIncorrectStream() публичный статический Метод

This is intended to MsgPack for CLI internal use. Do not use this type from application directly. Returns new exception to notify that the underlying stream is not correct semantically because failed to unpack items count of array/map.
public static NewIsIncorrectStream ( Exception innerException ) : Exception
innerException System.Exception The inner exception for the debug. The value is implementation specific.
Результат System.Exception
Пример #1
0
        public static int GetItemsCount(Unpacker unpacker)
        {
            if (unpacker == null)
            {
                throw new ArgumentNullException("unpacker");
            }

            long rawItemsCount;

            try
            {
                rawItemsCount = unpacker.ItemsCount;
            }
            catch (InvalidOperationException ex)
            {
                throw SerializationExceptions.NewIsIncorrectStream(ex);
            }

            if (rawItemsCount > Int32.MaxValue)
            {
                throw SerializationExceptions.NewIsTooLargeCollection();
            }

            int count = unchecked (( int )rawItemsCount);

            return(count);
        }
Пример #2
0
        internal static int GetItemsCount(Unpacker unpacker)
        {
            long itemsCount;

            try
            {
                itemsCount = unpacker.ItemsCount;
            }
            catch (InvalidOperationException exception)
            {
                throw SerializationExceptions.NewIsIncorrectStream(exception);
            }
            if (itemsCount > 0x7fffffffL)
            {
                throw SerializationExceptions.NewIsTooLargeCollection();
            }
            return((int)itemsCount);
        }
Пример #3
0
        internal static int GetItemsCount(Unpacker unpacker)
        {
            long rawItemsCount;

            try
            {
                rawItemsCount = unpacker.ItemsCount;
            }
            catch (InvalidOperationException ex)
            {
                throw SerializationExceptions.NewIsIncorrectStream(ex);
            }

            if (rawItemsCount > Int32.MaxValue)
            {
                throw SerializationExceptions.NewIsTooLargeCollection();
            }

            int count = unchecked (( int )rawItemsCount);

            return(count);
        }