@Override
    public AttributeValue marshall(Object obj) {
        @SuppressWarnings("unchecked")
        Set<ByteBuffer> buffers = (Set<ByteBuffer>) obj;
        List<ByteBuffer> attributes = new ArrayList<ByteBuffer>(buffers.size());

        for (ByteBuffer b : buffers) {
            attributes.add(b);
        }

        return new AttributeValue().withBS(attributes);
    }
A marshaller that marshals sets of Java {@code ByteBuffer}s into DynamoDB
BinarySet attributes.
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/marshallers/ByteBufferSetToBinarySetMarshaller.java