-
Jan 9th, 2008, 08:03 AM
#1
FlatFileOutputSource cast exception on primitives write
I'm trying to write a byte array to a flat file using the FlatFileOutputSource.
In the convertAndWrite function, I'm getting a class cast exception on the following line:
Object[] array = (Object[]) data;
(data is of type byte)
Is this the desired functionality or am I off base?
Also, trying to write this out as a continuous stream, with no line breaks. Should I be using the FlatFileOutputSource, extend it or roll my own?
-
Jan 9th, 2008, 11:18 AM
#2
Just for clarification, what exactly are you trying to write out? I was a bit confused reading it...also, I'm assuming you're using Java 5?
-
Jan 9th, 2008, 11:46 AM
#3
Trying to read and write ISO 8583-1993 files - Financial Transactions specification (IPM clearing file).
The file format is a stream of data, with no line breaks, where each record is defined by a length indicator, transaction type, bitmap address and data fields as defined by the bitmap address.
Yes Java 5, spring batch m2.
Last edited by gjones; Jan 9th, 2008 at 11:49 AM.
-
Jan 9th, 2008, 03:12 PM
#4
I think you're on the wrong track. FlatFileItemWriter (the new name) is for text files (writing Strings with new lines). You probably need to write your own ItemWriter (aka OutputSource) that handles your byte[] data in the way you need.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules