in src/main/java/software/amazon/sns/AmazonSNSExtendedClient.java [174:192]
private long getMessageAttributeSize(String MessageAttributeKey, MessageAttributeValue value) {
long messageAttributeSize = Util.getStringSizeInBytes(MessageAttributeKey);
if (value.getDataType() != null) {
messageAttributeSize += Util.getStringSizeInBytes(value.getDataType());
}
String stringVal = value.getStringValue();
if (stringVal != null) {
messageAttributeSize += Util.getStringSizeInBytes(stringVal);
}
ByteBuffer binaryVal = value.getBinaryValue();
if (binaryVal != null) {
messageAttributeSize += binaryVal.array().length;
}
return messageAttributeSize;
}