Package org.msgpack

Examples of org.msgpack.MessageTypeException


        // optimized not to allocate shortAccept
        stack.checkCount();
        readOneWithoutStack(intAccept);
        int value = intAccept.value;
        if(value < (int)Short.MIN_VALUE || value > (int)Short.MAX_VALUE) {
            throw new MessageTypeException()// TODO message
        }
        stack.reduceCount();
        return (short)value;
    }
View Full Code Here


    }

    @Override
    public void readArrayEnd(boolean check) throws IOException {
        if(!stack.topIsArray()) {
            throw new MessageTypeException("readArrayEnd() is called but readArrayBegin() is not called");
        }

        int remain = stack.getTopCount();
        if(remain > 0) {
            if(check) {
                throw new MessageTypeException("readArrayEnd(check=true) is called but the array is not end");
            }
            for(int i=0; i < remain; i++) {
                skip();
            }
        }
View Full Code Here

    }

    @Override
    public void readMapEnd(boolean check) throws IOException {
        if(!stack.topIsMap()) {
            throw new MessageTypeException("readMapEnd() is called but readMapBegin() is not called");
        }

        int remain = stack.getTopCount();
        if(remain > 0) {
            if(check) {
                throw new MessageTypeException("readMapEnd(check=true) is called but the map is not end");
            }
            for(int i=0; i < remain; i++) {
                skip();
            }
        }
View Full Code Here

    private LongArrayTemplate() { }

    public void write(Packer pk, long[] target, boolean required) throws IOException {
        if (target == null) {
            if (required) {
                throw new MessageTypeException("Attempted to write null");
            }
            pk.writeNil();
            return;
        }
        pk.writeArrayBegin(target.length);
View Full Code Here

    private BigDecimalTemplate() { }

    public void write(Packer pk, BigDecimal target, boolean required) throws IOException {
        if(target == null) {
            if(required) {
                throw new MessageTypeException("Attempted to write null");
            }
            pk.writeNil();
            return;
        }
        pk.writeString(target.toString());
View Full Code Here

    private FloatArrayTemplate() { }

    public void write(Packer pk, float[] target, boolean required) throws IOException {
        if (target == null) {
            if (required) {
                throw new MessageTypeException("Attempted to write null");
            }
            pk.writeNil();
            return;
        }
        pk.writeArrayBegin(target.length);
View Full Code Here

    private ValueTemplate() { }

    public void write(Packer pk, Value target, boolean required) throws IOException {
        if (target == null) {
            if (required) {
                throw new MessageTypeException("Attempted to write null");
            }
            pk.writeNil();
            return;
        }
        pk.write(target);
View Full Code Here

    private StringTemplate() { }

    public void write(Packer pk, String target, boolean required) throws IOException {
        if (target == null) {
            if (required) {
                throw new MessageTypeException("Attempted to write null");
            }
            pk.writeNil();
            return;
        }
        pk.writeString(target);
View Full Code Here

import org.msgpack.MessageTypeException;


abstract class Accept implements BufferReferer {
    void acceptBoolean(boolean v) {
        throw new MessageTypeException("Unexpected boolean value");
    }
View Full Code Here

    void acceptBoolean(boolean v) {
        throw new MessageTypeException("Unexpected boolean value");
    }

    void acceptInteger(byte v) {
        throw new MessageTypeException("Unexpected integer value");
    }
View Full Code Here

TOP

Related Classes of org.msgpack.MessageTypeException

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.