Validate Large EDI File

There is a EDI file sitting on the file system for validation. I would like to use wm.b2b.edi:envelopeProcess first. If I load file into string (getFile as bytes and convert to String) and call wm.b2b.edi:envelopeProcess, it is fine. But I cannot get stream version code to work (getFile as stream then envelopeProcess), it give me some error: Unrecognized EDI data (not ANSI X12 nor UN/EDIFACT).

Any suggestions? I am expecting large data set so string might not be enough (how big is it anyway?).

Thanks!

try this
wm.tn.doc:getContentPartData
wm.b2b.edi.util.streamToString
wm.b2b.edi.envelopeProcess

hth

Thanks for the info. In my case, I have a large EDI file (say 100 MB), I am not sure about the streamToString can handle this. What do you think?