protected int getSizeOf(AMQShortString string) { return EncodingUtils.encodedShortStringLength(string); }
size += EncodingUtils.encodedShortStringLength(_contentType); size += EncodingUtils.encodedShortStringLength(_encoding); size += EncodingUtils.encodedShortStringLength(_correlationId); size += EncodingUtils.encodedShortStringLength(_replyTo); size += EncodingUtils.encodedShortStringLength(ZERO_STRING); size += EncodingUtils.encodedShortStringLength(_expiration); size += EncodingUtils.encodedShortStringLength(_messageId); size += EncodingUtils.encodedShortStringLength(_type); size += EncodingUtils.encodedShortStringLength(_userId); size += EncodingUtils.encodedShortStringLength(_appId); size += EncodingUtils.encodedShortStringLength(_clusterId);
@Override public int getStorableSize() { int size = _contentHeaderBody.getSize(); size += 4; size += EncodingUtils.encodedShortStringLength(_messagePublishInfo.getExchange()); size += EncodingUtils.encodedShortStringLength(_messagePublishInfo.getRoutingKey()); size += 1; // flags for immediate/mandatory size += EncodingUtils.encodedLongLength(); return size; }
FieldTable(Map<String, Object> properties, boolean strictAMQP) { _strictAMQP = strictAMQP; long size = 0; Map<String, AMQTypedValue> m = new LinkedHashMap<>(); if (properties != null && !properties.isEmpty()) { m = new LinkedHashMap<>(); for (Map.Entry<String, Object> e : properties.entrySet()) { String key = e.getKey(); Object val = e.getValue(); checkPropertyName(key); AMQTypedValue value = getAMQTypeValue(val); size += EncodingUtils.encodedShortStringLength(e.getKey()) + 1 + value.getEncodingSize(); m.put(e.getKey(), value); } } _properties = m; _encodedSize = size; _decoded = true; }