Package org.msgpack.core

Examples of org.msgpack.core.MessageIntegerOverflowException


            case LONG:
                if(LongUtil.isValidByte(longValue)) {
                    return (byte) longValue;
                }
                else {
                    throw new MessageIntegerOverflowException(longValue);
                }
            case BIG_INTEGER:
                if(LongUtil.isValidByte(biValue)) {
                    return biValue.byteValue();
                }
                else {
                    throw new MessageIntegerOverflowException(biValue);
                }
            default:
                throw failure();
        }
    }
View Full Code Here


            case LONG:
                if(LongUtil.isValidShort(longValue)) {
                    return (short) longValue;
                }
                else {
                    throw new MessageIntegerOverflowException(longValue);
                }
            case BIG_INTEGER:
                if(LongUtil.isValidShort(biValue)) {
                    return biValue.shortValue();
                }
                else {
                    throw new MessageIntegerOverflowException(biValue);
                }
            default:
                throw failure();
        }
    }
View Full Code Here

            case LONG:
                if(LongUtil.isValidInt(longValue)) {
                    return (int) longValue;
                }
                else {
                    throw new MessageIntegerOverflowException(longValue);
                }
            case BIG_INTEGER:
                if(LongUtil.isValidInt(biValue)) {
                    return biValue.intValue();
                }
                else {
                    throw new MessageIntegerOverflowException(biValue);
                }
            default:
                throw failure();
        }
    }
View Full Code Here

    public long asLong() throws MessageIntegerOverflowException {
        if(isBigInteger()){
            if(LongUtil.isValidLong(biValue)) {
                return biValue.longValue();
            } else {
                throw new MessageIntegerOverflowException(biValue);
            }
        }
        return longValue;
    }
View Full Code Here

    }

    @Override
    public byte asByte() throws MessageIntegerOverflowException {
        if (!isValidByte()) {
            throw new MessageIntegerOverflowException(value);
        }
        return value.byteValue();
    }
View Full Code Here

    }

    @Override
    public short asShort() throws MessageIntegerOverflowException {
        if (!isValidShort()) {
            throw new MessageIntegerOverflowException(value);
        }
        return value.shortValue();
    }
View Full Code Here

    }

    @Override
    public int asInt() throws MessageIntegerOverflowException {
        if (!isValidInt()) {
            throw new MessageIntegerOverflowException(value);
        }
        return value.intValue();
    }
View Full Code Here

    }

    @Override
    public long asLong() throws MessageIntegerOverflowException {
        if (!isValidLong()) {
            throw new MessageIntegerOverflowException(value);
        }
        return value.longValue();
    }
View Full Code Here

    }

    @Override
    public byte asByte() throws MessageOverflowException {
        if (!isValidByte()) {
            throw new MessageIntegerOverflowException(value);
        }
        return (byte) value;
    }
View Full Code Here

    }

    @Override
    public short asShort() throws MessageOverflowException {
        if (!isValidShort()) {
            throw new MessageIntegerOverflowException(value);
        }
        return (short) value;
    }
View Full Code Here

TOP

Related Classes of org.msgpack.core.MessageIntegerOverflowException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.