static Binary integerToTransactionId(final int txnId) { byte[] data = new byte[4]; data[3] = (byte) (txnId & 0xff); data[2] = (byte) ((txnId & 0xff00) >> 8); data[1] = (byte) ((txnId & 0xff0000) >> 16); data[0] = (byte) ((txnId & 0xff000000) >> 24); return new Binary(data); }
static Object fixValue(final Object value) { if(value instanceof byte[]) { return new Binary((byte[])value); } else if(value instanceof Map) { return fixMapValues((Map)value); } else if(value instanceof List) { return fixListValues((List)value); } else { return value; } }
private void continueSaslNegotiation(final byte[] challenge) { SaslChallenge challengeBody = new SaslChallenge(); challengeBody.setChallenge(new Binary(challenge)); send(new SASLFrame(challengeBody)); _connectionState = ConnectionState.AWAIT_SASL_RESPONSE; }
@Override public Binary construct(final QpidByteBuffer in, final ValueHandler handler) throws AmqpErrorException { int size; if (!in.hasRemaining(getSize())) { throw new AmqpErrorException(AmqpError.DECODE_ERROR, "Cannot construct binary: insufficient input data"); } if (getSize() == 1) { size = in.getUnsignedByte(); } else { size = in.getInt(); } if (!in.hasRemaining(size)) { throw new AmqpErrorException(AmqpError.DECODE_ERROR, "Cannot construct binary: insufficient input data"); } byte[] data = new byte[size]; in.get(data); return new Binary(data); } }
props.setUserId(new Binary(contentHeader.getUserId().getBytes()));
final Binary tag = new Binary(data);
if (finalChallenge) outcome.setAdditionalData(new Binary(challenge));
if(userId != null) properties.setUserId(new Binary(userId.getBytes(StandardCharsets.UTF_8)));