/** * Concatenates 2 SimpleString's * @param toAdd the SimpleString to concatenate with. * @return the concatenated SimpleString */ public SimpleString concat(final SimpleString toAdd) { byte[] bytes = new byte[data.length + toAdd.getData().length]; System.arraycopy(data, 0, bytes, 0, data.length); System.arraycopy(toAdd.getData(), 0, bytes, data.length, toAdd.getData().length); return new SimpleString(bytes); }
private void writeSimpleStringInternal(final SimpleString val) { byte[] data = val.getData(); buffer.writeInt(data.length); buffer.writeBytes(data); }
/** * Concatenates 2 SimpleString's * * @param toAdd the SimpleString to concatenate with. * @return the concatenated SimpleString */ public SimpleString concat(final SimpleString toAdd) { byte[] bytes = new byte[data.length + toAdd.getData().length]; System.arraycopy(data, 0, bytes, 0, data.length); System.arraycopy(toAdd.getData(), 0, bytes, data.length, toAdd.getData().length); return new SimpleString(bytes); }
@Override public byte[] getDuplicateIDBytes() { Object duplicateID = getDuplicateProperty(); if (duplicateID == null) { return null; } else { if (duplicateID instanceof SimpleString) { return ((SimpleString) duplicateID).getData(); } else { return (byte[]) duplicateID; } } }
public byte[] getDuplicateIDBytes() { Object duplicateID = getDuplicateProperty(); if (duplicateID == null) { return null; } else { if (duplicateID instanceof SimpleString) { return ((SimpleString)duplicateID).getData(); } else { return (byte[])duplicateID; } } }
private void writeSimpleStringInternal(final SimpleString val) { byte[] data = val.getData(); buffer.writeInt(data.length); buffer.writeBytes(data); }
public synchronized void encode(final HornetQBuffer buffer) { if (properties == null) { buffer.writeByte(DataConstants.NULL); } else { buffer.writeByte(DataConstants.NOT_NULL); buffer.writeInt(properties.size()); for (Map.Entry<SimpleString, PropertyValue> entry : properties.entrySet()) { SimpleString s = entry.getKey(); byte[] data = s.getData(); buffer.writeInt(data.length); buffer.writeBytes(data); entry.getValue().write(buffer); } } }
public synchronized void encode(final HornetQBuffer buffer) { if (properties == null) { buffer.writeByte(DataConstants.NULL); } else { buffer.writeByte(DataConstants.NOT_NULL); buffer.writeInt(properties.size()); for (Map.Entry<SimpleString, PropertyValue> entry : properties.entrySet()) { SimpleString s = entry.getKey(); byte[] data = s.getData(); buffer.writeInt(data.length); buffer.writeBytes(data); entry.getValue().write(buffer); } } }