기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
이진 데이터 처리 변경 사항
버전 1에서는 ByteBuffer
객체를 직접 사용하여 이진 데이터를 처리했습니다. 버전 2에서 SDK는 이진 데이터로 작업하는 보다 편리하고 유형 안전한 방법을 제공하는 SdkBytes
객체를 사용합니다.
마이그레이션 도구를 사용하여를 ByteBuffer
자동으로 SdkBytes
로 변환하거나 반환된 SdkBytes
객체asByteBuffer()
에서를 호출하여 수동으로 변환할 수 있습니다.
예 - 버전 1의 메시지 속성에서 이진 데이터 가져오기
// Get binary data from a message attribute MessageAttributeValue messageAttributeValue = new MessageAttributeValue(); ByteBuffer binaryValue = messageAttributeValue.getBinaryValue(); String binaryString = new String(messageAttributeValue.getBinaryValue().array());
예 - 버전 2의 메시지 속성에서 이진 데이터 가져오기
// Get binary data from a message attribute MessageAttributeValue messageAttributeValue = MessageAttributeValue.builder().build(); ByteBuffer binaryValue = messageAttributeValue.binaryValue().asByteBuffer(); String binaryString = new String(messageAttributeValue.binaryValue().asByteBuffer().array());