com.amazonaws.util.StringUtils.fromByteBuffer()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(73)

本文整理了Java中com.amazonaws.util.StringUtils.fromByteBuffer()方法的一些代码示例,展示了StringUtils.fromByteBuffer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StringUtils.fromByteBuffer()方法的具体详情如下:
包路径:com.amazonaws.util.StringUtils
类名称:StringUtils
方法名:fromByteBuffer

StringUtils.fromByteBuffer介绍

[英]Base64 encodes the data in the specified byte buffer (from the current position to the buffer's limit) and returns it as a base64 encoded string.
[中]Base64对指定字节缓冲区中的数据进行编码(从当前位置到缓冲区的限制),并将其作为Base64编码字符串返回。

代码示例

代码示例来源:origin: aws/aws-sdk-java

StringUtils.fromByteBuffer(entry.getValue().getBinaryValue()));
if (binaryListValuesListValue != null) {
  request.addParameter("MessageAttribute." + messageAttributesListIndex + ".Value.BinaryListValue." + binaryListValuesListIndex,
      StringUtils.fromByteBuffer(binaryListValuesListValue));

代码示例来源:origin: aws/aws-sdk-java

+ ".Value.BinaryValue", StringUtils.fromByteBuffer(entry.getValue().getBinaryValue()));
if (binaryListValuesListValue != null) {
  request.addParameter("SendMessageBatchRequestEntry." + entriesListIndex + ".MessageAttribute." + messageAttributesListIndex
      + ".Value.BinaryListValue." + binaryListValuesListIndex, StringUtils.fromByteBuffer(binaryListValuesListValue));

代码示例来源:origin: aws/aws-sdk-java

StringUtils.fromByteBuffer(entry.getValue().getBinaryValue()));

代码示例来源:origin: aws/aws-sdk-java

request.addParameter("RawMessage.Data", StringUtils.fromByteBuffer(rawMessage.getData()));

代码示例来源:origin: aws-amplify/aws-sdk-android

public void marshall(RawMessage _rawMessage, Request<?> request, String _prefix) {
  String prefix;
  if (_rawMessage.getData() != null) {
    prefix = _prefix + "Data";
    java.nio.ByteBuffer data = _rawMessage.getData();
    request.addParameter(prefix, StringUtils.fromByteBuffer(data));
  }
}

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * Tests that {@link StringUtils#fromByteBuffer(ByteBuffer)} correctly
 * base64 encodes the contents in a ByteBuffer and returns the correct
 * result.
 */
@Test
public void testFromByteBuffer() {
  final String expectedData = "hello world";
  final String expectedEncodedData = "aGVsbG8gd29ybGQ=";
  final ByteBuffer byteBuffer = ByteBuffer.wrap(expectedData.getBytes(UTF8));
  final String encodedData = StringUtils.fromByteBuffer(byteBuffer);
  assertEquals(expectedEncodedData, encodedData);
}

代码示例来源:origin: aws-amplify/aws-sdk-android

public void marshall(MessageAttributeValue _messageAttributeValue, Request<?> request,
    String _prefix) {
  String prefix;
  if (_messageAttributeValue.getDataType() != null) {
    prefix = _prefix + "DataType";
    String dataType = _messageAttributeValue.getDataType();
    request.addParameter(prefix, StringUtils.fromString(dataType));
  }
  if (_messageAttributeValue.getStringValue() != null) {
    prefix = _prefix + "StringValue";
    String stringValue = _messageAttributeValue.getStringValue();
    request.addParameter(prefix, StringUtils.fromString(stringValue));
  }
  if (_messageAttributeValue.getBinaryValue() != null) {
    prefix = _prefix + "BinaryValue";
    java.nio.ByteBuffer binaryValue = _messageAttributeValue.getBinaryValue();
    request.addParameter(prefix, StringUtils.fromByteBuffer(binaryValue));
  }
}

代码示例来源:origin: aws-amplify/aws-sdk-android

prefix = _prefix + "BinaryValue";
java.nio.ByteBuffer binaryValue = _messageAttributeValue.getBinaryValue();
request.addParameter(prefix, StringUtils.fromByteBuffer(binaryValue));
  prefix = binaryListValuesPrefix + "." + binaryListValuesIndex;
  if (binaryListValuesItem != null) {
    request.addParameter(prefix, StringUtils.fromByteBuffer(binaryListValuesItem));

代码示例来源:origin: com.amazonaws/aws-java-sdk-sqs

StringUtils.fromByteBuffer(entry.getValue().getBinaryValue()));
if (binaryListValuesListValue != null) {
  request.addParameter("MessageAttribute." + messageAttributesListIndex + ".Value.BinaryListValue." + binaryListValuesListIndex,
      StringUtils.fromByteBuffer(binaryListValuesListValue));

代码示例来源:origin: com.amazonaws/aws-java-sdk-sqs

+ ".Value.BinaryValue", StringUtils.fromByteBuffer(entry.getValue().getBinaryValue()));
if (binaryListValuesListValue != null) {
  request.addParameter("SendMessageBatchRequestEntry." + entriesListIndex + ".MessageAttribute." + messageAttributesListIndex
      + ".Value.BinaryListValue." + binaryListValuesListIndex, StringUtils.fromByteBuffer(binaryListValuesListValue));

代码示例来源:origin: com.amazonaws/aws-android-sdk-sns

public void marshall(MessageAttributeValue _messageAttributeValue, Request<?> request,
    String _prefix) {
  String prefix;
  if (_messageAttributeValue.getDataType() != null) {
    prefix = _prefix + "DataType";
    String dataType = _messageAttributeValue.getDataType();
    request.addParameter(prefix, StringUtils.fromString(dataType));
  }
  if (_messageAttributeValue.getStringValue() != null) {
    prefix = _prefix + "StringValue";
    String stringValue = _messageAttributeValue.getStringValue();
    request.addParameter(prefix, StringUtils.fromString(stringValue));
  }
  if (_messageAttributeValue.getBinaryValue() != null) {
    prefix = _prefix + "BinaryValue";
    java.nio.ByteBuffer binaryValue = _messageAttributeValue.getBinaryValue();
    request.addParameter(prefix, StringUtils.fromByteBuffer(binaryValue));
  }
}

代码示例来源:origin: com.amazonaws/aws-android-sdk-sqs

prefix = _prefix + "BinaryValue";
java.nio.ByteBuffer binaryValue = _messageAttributeValue.getBinaryValue();
request.addParameter(prefix, StringUtils.fromByteBuffer(binaryValue));
  prefix = binaryListValuesPrefix + "." + binaryListValuesIndex;
  if (binaryListValuesItem != null) {
    request.addParameter(prefix, StringUtils.fromByteBuffer(binaryListValuesItem));

代码示例来源:origin: com.amazonaws/aws-java-sdk-ses

request.addParameter("RawMessage.Data", StringUtils.fromByteBuffer(rawMessage.getData()));

相关文章