public Set<ByteBuffer> getByteBufferSet(String attrName) {
        Object val = attributes.get(attrName);
        if (val == null)
            return null;
        Set<ByteBuffer> binarySet = new LinkedHashSet<ByteBuffer>();
        if (val instanceof Collection) {
            Collection<?> col = (Collection<?>) val;
            if (col.size() == 0)
                return binarySet;
            for (Object element: col) {
                ByteBuffer ba = toByteBuffer(element);
                if (!binarySet.add(ba))
                    throw new IncompatibleTypeException(val.getClass()
                        + " cannot be converted into a set of ByteBuffer because of duplicate elements");
            }
            return binarySet;
        } else if (val instanceof ByteBuffer) {
            // Defensive code but execution should never get here. The internal
            // representation of binary should always be
            // byte[], not ByteBuffer. This allows Item to be converted into
            // a JSON string via Jackson without causing trouble.
            binarySet.add((ByteBuffer)val);
            return binarySet;
        } else if (val instanceof byte[]) {
            binarySet.add(ByteBuffer.wrap((byte[])val));
            return binarySet;
        }
        throw new IncompatibleTypeException(val.getClass()
                + " cannot be converted into a set of ByteBuffer");
    }
Returns the value of the specified attribute in the current item as a set
of <code>ByteBuffer</code>; or null if the attribute either doesn't exist
or the attribute value is null.

@throws IncompatibleTypeException
            if the attribute value cannot be converted into a set of
            <code>ByteBuffer</code>

@see #isNull(String) #isNull(String) to check if the attribute value is
     null.
@see #isPresent(String) #isPresent(String) to check if the attribute
     value is present.
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java