

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 바이너리 데이터 처리 변경
<a name="migration-binary-data"></a>

버전 1에서는 `ByteBuffer` 객체를 직접 사용하여 바이너리 데이터를 처리했습니다. 버전 2에서 SDK는 바이너리 데이터로 작업하는 보다 편리하고 유형에 안전한 방법을 제공하는 `SdkBytes` 객체를 사용합니다.

[마이그레이션 도구](migration-tool.md)를 사용하여 `SdkBytes`를 자동으로 `ByteBuffer`로 변환하거나 반환된 `SdkBytes` 객체에서 `asByteBuffer()`를 직접적으로 호출하여 수동으로 변환할 수 있습니다.

**Example - 버전 1의 메시지 속성에서 바이너리 데이터 가져오기**  

```
// Get binary data from a message attribute
MessageAttributeValue messageAttributeValue = new MessageAttributeValue();
ByteBuffer binaryValue = messageAttributeValue.getBinaryValue();
String binaryString = new String(messageAttributeValue.getBinaryValue().array());
```

**Example - 버전 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());
```