Announcement Announcement Module
Collapse
No announcement yet.
FlatFileOutputSource cast exception on primitives write Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #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?

    Comment


    • #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, 11:49 AM.

      Comment


      • #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.

        Comment

        Working...
        X