I have a formatted ebcdic byte[] which i have created using custom code. Now I want to write to file. I am able to do this using Java. I was trying to check if i can do this using a Spring writer. I tried using FlatFileItemWriter . but just wrote a set of objects to file. Also the problem is that the Item writer also introduces a new line after each item. Ebcdic is however is a single stream of bytes for the entire file. ItemWriter ebcdicByteWriter;
@Override
public void write(List<? extends AccountInvoice> items) throws Exception {
ArrayList<byte[]> finalList= new ArrayList<byte[]>();
for (AccountInvoice item : items) {
finalList.add(item.getEbcdicBytes());
}
ebcdicByteWriter.write(finalList);
}