NewIsIncorrectStream() public static méthode

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.
Résultat System.Exception
Exemple #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);
        }
        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);
        }
Exemple #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);
        }