private boolean fixedValueSizeMatch()

in java/avro-converter/src/main/java/com/microsoft/azure/schemaregistry/kafka/connect/avro/AvroConverterUtils.java [1354:1366]


    private boolean fixedValueSizeMatch(Schema fieldSchema, Object value, int size, int index) {
        if (value instanceof byte[]) {
            return ((byte[]) value).length == size;
        } else if (value instanceof ByteBuffer) {
            return ((ByteBuffer) value).remaining() == size;
        } else if (value instanceof GenericFixed) {
            return unionMemberFieldName(((GenericFixed) value).getSchema(), index)
                .equals(unionMemberFieldName(fieldSchema, index));
        } else {
            throw new DataException("Invalid class for fixed, expecting GenericFixed, byte[]"
                + " or ByteBuffer but found " + value.getClass());
        }
    }