Is there an smart way to write a fixed length flat file?
问题 Is there any framework/library to help writing fixed length flat files in java? I want to write a collection of beans/entities into a flat file without worrying with convertions, padding, alignment, fillers, etcs For example, I'd like to parse a bean like: public class Entity{ String name = "name"; // length = 10; align left; fill with spaces Integer id = 123; // length = 5; align left; fill with spaces Integer serial = 321 // length = 5; align to right; fill with '0' Date register = new Date