Fixed File Write (Source Code)
It is used when writing a file in a fixed length format using source code.
private FixedFileWriter<MSmpMultiFileWriteBtch02Dto> empInfoFixedWriter;
public void open(ExecutionContext executionContext) throws ItemStreamException {
……
String empInfoFixedFileName = "/data1/prod/bxm500/dat/fixed_file_" + oDate + ".txt";
empInfoFixedWriter= DefaultFileUtils.getFixedFileWriter(empInfoFixedFileName, MSmpMultiFileWriteBtch02Dto.class, "UTF-8");
empInfoFixedWriter.open(executionContext); // File Open
……
}
public void write(List<? extends MSmpMultiFileWriteBtch02Dto> in) throws Exception {
…
empInfoFixedWriter.write(mSmpMultiFileWriteBtch02Dtos); // Fixed File Write
}
……
public void update(ExecutionContext executionContext) throws ItemStreamException {
if(empInfoFixedWriter != null) empInfoFixedWriter.update(executionContext);
}
public void close() throws ItemStreamException {
if(empInfoFixedWriter != null) empInfoFixedWriter.close();
}