Hi Ioan, Mime4j's BufferedLineReaderInputStream bridges the gap between byte and character streams. It lets you read lines of text from a byte stream into a ByteArrayBuffer. Then you can use class ContentUtil to decode the ByteArrayBuffer into a String. You can also push back (unread) content. Maybe that helps with your project.
Cheers, Markus On Fri, Feb 10, 2012 at 9:46 PM, Ioan Eugen STAN <[email protected]>wrote: > On Jo 09 feb 2012 15:43:35 +0200, Oleg Kalnichevski wrote: > > On Thu, 2012-02-09 at 12:23 +0200, Ioan Eugen Stan wrote: > >> Hello, > >> > >> This is the second try to get the message on the mailing list. > >> > >> I've started working on a small project called mbox-iterator that I wish > >> to integrate with mime4j later, when it's more usable. It's purpose is > >> to provide a iterator like interface over mbox files. Details about the > >> project are here [1]. > >> > >> I'm bringing it on because I think this would be a nice addition to > >> mime4j and I need some help. > >> > >> One thing that I can't figure out is: does mime4j do charset decoding? I > >> haven't looked over the code but I know it expects a stream of bytes. > >> > > > > The MIME parser takes raw data stream as input but can provide fully > > decoded Reader for individual body parts. > > > > Hope this helps > > > > Oleg > > Hello Oleg, > > From what you said, messages are treated like byte streams or encoded > using a 7/8 bit encoding. I will check this when I will do the actual > merge with mime4j. > > Thanks, > > @Emilian Sorry for being late with the implementation. Nice to hear > from you. > > > > >> mbox-iterator does regexp matching to find From_ lines and that requires > >> a CharSequence. This means I have use/return CharBuffer's from the > >> iterator. The CharBuffers need to be re-encoded and streamed as bytes > >> (maybe with ByteArrayInputStream). > >> > >> In the future I plan to use git-svn to experiment new stuff but I would > >> like to get it fast into mime4j. What do you think? > >> > >> > >> [1] > >> > http://ieugen.blogspot.com/2012/02/nio-iterator-over-messages-in-mbox-file.html > >> > >> Cheers, > > > > > > >
