Menu

Problem with java.nio

Help
Ivir
2005-05-05
2013-05-01
  • Ivir

    Ivir - 2005-05-05

    Hi,

    I'm trying to access some mbox files using mstor.
    I'm using eclipse 3.1m6 with jdk 1.5_02
    I've included the javamail, jaf and mstor classes to the projects build path, everything seems to be ok.

    I've pasted the example from the home page and it functioned alright. but then I tried to access another valid mbox file and I get this exception(?)/message:

    May 5, 2005 11:31:12 PM net.fortuna.mstor.data.MboxFile getMessagePositions
    WARNING: Error reading message positions using nio. Trying random access file..
    java.nio.charset.MalformedInputException: Input length = 1
        at java.nio.charset.CoderResult.throwException(Unknown Source)
        at java.nio.charset.CharsetDecoder.decode(Unknown Source)
        at net.fortuna.mstor.data.MboxFile.getMessagePositions(Unknown Source)
        at net.fortuna.mstor.data.MboxFile.getMessageCount(Unknown Source)
        at net.fortuna.mstor.MStorFolder.getMessageCount(Unknown Source)
        at javax.mail.Folder.getMessages(Folder.java:908)
        at MBoxSplitter.main(MBoxSplitter.java:18)

    I'm really confused with the output.Any ideas?

     
    • Ben Fortuna

      Ben Fortuna - 2005-05-05

      Hi Ivir,

      Assuming you are using mstor 0.9.3, I think what is happening is that mstor is using the default file encoding of your operating system to read the mbox file (on Linux I think this is utf-8), however the mbox file is in a different encoding (most likely iso-8895-1).

      In mstor 0.9.4 (not yet released) I have reduced the amount of decoding performed by mstor and have reverted to using the same encoding (iso-8895-1) unless otherwise specified.

      This release is long overdue, so I might just bite the bullet and release it in its current state.

      regards,
      ben

       
    • Ivir

      Ivir - 2005-05-06

      Hi Ben,

      Thank you for your fast reply. Yes I'm using 0.9.3 version.
      I've also tried under Gentoo/Linux x64 with both 32 and 64bit jdk/eclipse, the same problem occurs.
      I'm waiting the next release :)

      Ivir

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.