Examples of MessageTypeException


Examples of org.msgpack.MessageTypeException

    @Override
    public T read(Unpacker pac, T to, boolean required) throws IOException, MessageTypeException {
        int ordinal = pac.readInt();
        if(entries.length <= ordinal) {
                throw new MessageTypeException(new IllegalArgumentException("ordinal: " + ordinal));
        }
        return entries[ordinal];
    }
View Full Code Here

Examples of org.msgpack.MessageTypeException

    private BigIntegerTemplate() { }

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

Examples of org.msgpack.MessageTypeException

    private ShortArrayTemplate() { }

    public void write(Packer pk, short[] 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

Examples of org.msgpack.MessageTypeException

    private BooleanTemplate() { }

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

Examples of org.msgpack.MessageTypeException

    @Override
    public void write(Packer packer, Object v, boolean required)
      throws IOException {
  if (v == null) {
      if (required) {
    throw new MessageTypeException("Attempted to write null");
      }
      packer.writeNil();
      return;
  }
  if (!(v instanceof Object[]) || !componentClass.isAssignableFrom(v.getClass().getComponentType())) {
      throw new MessageTypeException();
  }

  Object[] array = (Object[]) v;
  int length = array.length;
  packer.writeArrayBegin(length);
View Full Code Here

Examples of org.msgpack.MessageTypeException

    private ShortTemplate() { }

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

Examples of org.msgpack.MessageTypeException

            }
        default:
            //System.out.println("unknown b "+(b&0xff));
            // headByte = CS_INVALID
            headByte = REQUIRE_TO_READ_HEAD;
            throw new MessageTypeException("Invalid byte: "+b)// TODO error
        }
    }
View Full Code Here

Examples of org.msgpack.MessageTypeException

    private DoubleTemplate() { }

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

Examples of org.msgpack.MessageTypeException

        if(b == 0xc0) {
            stack.reduceCount();
            headByte = REQUIRE_TO_READ_HEAD;
            return;
        }
        throw new MessageTypeException("Expected nil but got not nil value");
    }
View Full Code Here

Examples of org.msgpack.MessageTypeException

        } else if(b == 0xc3) {
            stack.reduceCount();
            headByte = REQUIRE_TO_READ_HEAD;
            return true;
        }
        throw new MessageTypeException("Expected Boolean but got not boolean value");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.