@Override public int encode(ByteBuffer b) { if(isElementOfArray()) { if(b.remaining()>=2) { b.putShort(_value.shortValue()); return 2; } } else { if(b.remaining()>=3) { b.put((byte)0x60); b.putShort(_value.shortValue()); return 3; } } return 0; } }
@Override public int encode(ByteBuffer b) { if(isElementOfArray()) { if(b.remaining()>=2) { b.putShort(_value.shortValue()); return 2; } } else { if(b.remaining()>=3) { b.put((byte)0x60); b.putShort(_value.shortValue()); return 3; } } return 0; } }
@Override public int encode(ByteBuffer b) { if(isElementOfArray()) { if(b.remaining()>=2) { b.putShort(_value.shortValue()); return 2; } } else { if(b.remaining()>=3) { b.put((byte)0x60); b.putShort(_value.shortValue()); return 3; } } return 0; } }
public void fastWrite(EncoderImpl encoder, UnsignedShort value) { encoder.writeRaw(EncodingCodes.USHORT); encoder.writeRaw(value.shortValue()); }
public void writeValue(final UnsignedShort val) { getEncoder().writeRaw(val.shortValue()); }
public void writeValue(final UnsignedShort val) { getEncoder().writeRaw(val.shortValue()); }
public void writeValue(final UnsignedShort val) { getEncoder().writeRaw(val.shortValue()); }
public void writeValue(final UnsignedShort val) { getEncoder().writeRaw(val.shortValue()); }
@Override public void setObject(final String name, final Object value) throws JMSException { try { // primitives and String Object val = value; if (value instanceof UnsignedInteger) { val = ((UnsignedInteger) value).intValue(); } else if (value instanceof UnsignedShort) { val = ((UnsignedShort) value).shortValue(); } else if (value instanceof UnsignedByte) { val = ((UnsignedByte) value).byteValue(); } else if (value instanceof UnsignedLong) { val = ((UnsignedLong) value).longValue(); } TypedProperties.setObjectProperty(new SimpleString(name), val, map); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
@Override public void setObject(final String name, final Object value) throws JMSException { try { // primitives and String Object val = value; if (value instanceof UnsignedInteger) { val = ((UnsignedInteger) value).intValue(); } else if (value instanceof UnsignedShort) { val = ((UnsignedShort) value).shortValue(); } else if (value instanceof UnsignedByte) { val = ((UnsignedByte) value).byteValue(); } else if (value instanceof UnsignedLong) { val = ((UnsignedLong) value).longValue(); } TypedProperties.setObjectProperty(new SimpleString(name), val, map); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }