Hello, This feature is not currently supported.
I think the most straight forward possibility is to modify BufferedLineReaderInputStream so that it tracks the number of bytes it consummed. MimeTokenStream could then leverage an int getPosition method using the position within the rootentity. We would likely welcome warmly such a contribution. -> You can open a ticket related to this on our JIRA: https://issues.apache.org/jira/projects/MIME4J -> You can fire a PR on our Github I'm curious to know: what is your use case with this position? -- Best regards, Benoit TELLIER General manager of Linagora VIETNAM. Product owner for Team-Mail product. Chairman of the Apache James project. Mail: btell...@linagora.com Tel: (0033) 6 77 26 04 58 (WhatsApp, Signal) On Sep 12, 2023 9:17 PM, from Rajdip Ghosh Hello Mime4j Dev Team, I hope this message finds you well. I am currently working with Mime4j and have a question regarding obtaining the exact byte start and end pointer of each EML part while using MimeTokenParser. It seems that MimeTokenParser doesn't provide a direct way to retrieve the byte pointer. My research has shown that MimeEntity internally uses BufferedLineReaderInputStream, which utilizes a cyclic buffer and prefetches data from the provided input stream (EML as Stream). Unfortunately, using PositionInputStream has not been helpful in this context. I would greatly appreciate it if someone could provide guidance on how to accurately determine the byte pointer of an EML file when processing it with MimeTokenParser. Any insights or alternative approaches would be immensely helpful. Thank you in advance for your assistance, and I look forward to your expert advice on this matter. Regards, *Rajdip Ghosh* Email ID: rghosh...@gmail.com