NewIsTooLargeCollection() public static method

This is intended to MsgPack for CLI internal use. Do not use this type from application directly. Returns new exception to notify that the unpacking collection is too large to represents in the current runtime environment.
public static NewIsTooLargeCollection ( ) : Exception
return System.Exception
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }