/** * <p> * Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images. * </p> * <p> * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. * Users of the SDK should not perform Base64 encoding on this field. * </p> * <p> * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future * major version of the SDK. * </p> * * @param binaryValue * Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images. * @return Returns a reference to this object so that method calls can be chained together. */ public MessageAttributeValue withBinaryValue(java.nio.ByteBuffer binaryValue) { setBinaryValue(binaryValue); return this; }
public MessageAttributeValue unmarshall(StaxUnmarshallerContext context) throws Exception { MessageAttributeValue messageAttributeValue = new MessageAttributeValue(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return messageAttributeValue; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("DataType", targetDepth)) { messageAttributeValue.setDataType(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("StringValue", targetDepth)) { messageAttributeValue.setStringValue(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("BinaryValue", targetDepth)) { messageAttributeValue.setBinaryValue(ByteBufferStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return messageAttributeValue; } } } }
messageAttributeValue.setBinaryValue(ByteBufferStaxUnmarshaller.getInstance() .unmarshall(context)); continue;
messageAttributeValue.setBinaryValue(ByteBufferStaxUnmarshaller.getInstance() .unmarshall(context)); continue;