@Override
    public Object unmarshall(AttributeValue value) {
        Set<byte[]> result = new HashSet<byte[]>();

        for (ByteBuffer buffer : value.getBS()) {
            if (buffer.hasArray()) {
                result.add(buffer.array());
            } else {
                byte[] array = new byte[buffer.remaining()];
                buffer.get(array);
                result.add(array);
            }
        }

        return result;
    }
An unmarshaller that unmarshals BinarySet values as sets of Java
{@code byte[]}s.
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/unmarshallers/ByteArraySetUnmarshaller.java