I have a ClassA extends SpecificRecordBase is there an shorter/succinct way to do this new DataFileWriter<SpecificRecord>(new SpecificDatumWriter<SpecificRecord>()).setCodec(CodecFactory.snappyCodec()).create(ClassA.getSchema(), new File("../data/oye.txt"));