@Override public int encodeSize() { return DataConstants.SIZE_BYTE + SimpleString.sizeofString(val); }
private synchronized Object doRemoveProperty(final SimpleString key) { if (properties == null) { return null; } PropertyValue val = properties.remove(key); if (val == null) { return null; } else { size -= SimpleString.sizeofString(key) + val.encodeSize(); return val.getValue(); } }
private synchronized void doPutValue(final SimpleString key, final PropertyValue value) { if (key.startsWith(AMQ_PROPNAME)) { internalProperties = true; } PropertyValue oldValue = properties.put(key, value); if (oldValue != null) { size += value.encodeSize() - oldValue.encodeSize(); } else { size += SimpleString.sizeofString(key) + value.encodeSize(); } }
@Override public int expectedEncodeSize() { return PACKET_HEADERS_SIZE + SimpleString.sizeofString(storeName) + // buffer.writeSimpleString(storeName); DataConstants.SIZE_INT + // buffer.writeInt(pageNumber); DataConstants.SIZE_BOOLEAN; // buffer.writeBoolean(isDelete); }
@Override public int encodeSize() { return DataConstants.SIZE_BYTE + SimpleString.sizeofString(val); }
@Override public int getEncodeSize() { return SimpleString.sizeofString(groupId) + SimpleString.sizeofString(clusterName); }
@Override public int encodeSize() { return DataConstants.SIZE_BYTE + SimpleString.sizeofString(val); }
@Override public int encodeSize() { return DataConstants.SIZE_BYTE + SimpleString.sizeofString(val); }
@Override public int getEncodeSize() { return SimpleString.sizeofString(address) + DataConstants.SIZE_INT + duplID.length; }
@Override public int encodeSize() { return DataConstants.SIZE_BYTE + SimpleString.sizeofString(val); }
@Override public int encodeSize() { return DataConstants.SIZE_BYTE + SimpleString.sizeofString(val); }
@Override public int getEncodeSize() { return SimpleString.sizeofString(name) + DataConstants.SIZE_INT + (DataConstants.SIZE_BYTE * routingTypes.size()) + DataConstants.SIZE_BOOLEAN; } }
private synchronized Object doRemoveProperty(final SimpleString key) { if (properties == null) { return null; } PropertyValue val = properties.remove(key); if (val == null) { return null; } else { size -= SimpleString.sizeofString(key) + val.encodeSize(); return val.getValue(); } }
private synchronized Object doRemoveProperty(final SimpleString key) { if (properties == null) { return null; } PropertyValue val = properties.remove(key); if (val == null) { return null; } else { size -= SimpleString.sizeofString(key) + val.encodeSize(); return val.getValue(); } }
private synchronized Object doRemoveProperty(final SimpleString key) { if (properties == null) { return null; } PropertyValue val = properties.remove(key); if (val == null) { return null; } else { size -= SimpleString.sizeofString(key) + val.encodeSize(); return val.getValue(); } }
private synchronized Object doRemoveProperty(final SimpleString key) { if (properties == null) { return null; } PropertyValue val = properties.remove(key); if (val == null) { return null; } else { size -= SimpleString.sizeofString(key) + val.encodeSize(); return val.getValue(); } }
private synchronized Object doRemoveProperty(final SimpleString key) { if (properties == null) { return null; } PropertyValue val = properties.remove(key); if (val == null) { return null; } else { size -= SimpleString.sizeofString(key) + val.encodeSize(); return val.getValue(); } }
private synchronized Object doRemoveProperty(final SimpleString key) { if (properties == null) { return null; } PropertyValue val = properties.remove(key); if (val == null) { return null; } else { size -= SimpleString.sizeofString(key) + val.encodeSize(); return val.getValue(); } }
private synchronized void doPutValue(final SimpleString key, final PropertyValue value) { if (key.startsWith(AMQ_PROPNAME)) { internalProperties = true; } PropertyValue oldValue = properties.put(key, value); if (oldValue != null) { size += value.encodeSize() - oldValue.encodeSize(); } else { size += SimpleString.sizeofString(key) + value.encodeSize(); } }
@Test public void testSizeofString() throws Exception { Assert.assertEquals(DataConstants.SIZE_INT, SimpleString.sizeofString(new SimpleString(""))); SimpleString str = new SimpleString(RandomUtil.randomString()); Assert.assertEquals(DataConstants.SIZE_INT + str.getData().length, SimpleString.sizeofString(str)); }