Library writers and Streams

Post author
S Mcchesney

We recently purchased your library to generate some HIPAA files, and so far we've been doing very well.  But we ran into an interesting problem today.

Your writer classes, in general, take a Stream as an input.  I presume this is because the most obvious use cases for writing files are either to files or in memory - both of which have stream types that inherit from Stream.  However, we have run into file receivers (e.g. Zirmed/Waystar) that expect files written with a particular encoding (in this case, ANSI).  Stream-based writers do not support that.  TextWriter-based writers do.  But TextWriter, for reasons unknown, does not inherit from Stream.  So I cannot wrap my stream in a StreamWriter (which allows me to control encoding) and pass that into your library, and I really don't want to mess around with code pages to get the default file encoding I need.  So an update to the library that would accept a TextWriter as an input would be very helpful.

- Scott McChesney



  • Comment author

    Hello Scott,

    Internally, EdiWriter uses StreamWriter. The X12Writer constructor takes X12WriterSettings parameter which lets you to customize things such as Encoding, Separators, Postfx, etc. - see here and here for additional info.




  • Comment author
    S Mcchesney

    Well... that certainly makes it a lot easier.  I didn't even see that.  Thanks very much for pointing that out.

    - Scott


Please sign in to leave a comment.