if (CharSequence.class.isAssignableFrom(c)) // String
return Schema.create(Schema.Type.STRING);
if (ByteBuffer.class.isAssignableFrom(c)) // bytes
return Schema.create(Schema.Type.BYTES);
if (Collection.class.isAssignableFrom(c)) // array
throw new AvroRuntimeException("Can't find element type of Collection");
String fullName = c.getName();
Schema schema = names.get(fullName);
if (schema == null) {
String name = c.getSimpleName();
String space = c.getPackage() == null ? "" : c.getPackage().getName();