Oleg Sukhodolsky
2008-12-04 12:23:24 UTC
Hi,
from time to time I receive mails with empty attachments, i.e. the
message contains a part which marked as attachment but has
zero length. I would like to filter out such attachments
without reading and it looks like the condition
"part.getInputStream().available() == 0" can be used for this purpose,
but it is not documented, that this method must return non-zero for non-empty
streams, so I decided to check here if I can use check or I must read
the stream to find out that the stream is empty.
Thanks in advance, Oleg.
===========================================================================
To unsubscribe, send email to ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".
from time to time I receive mails with empty attachments, i.e. the
message contains a part which marked as attachment but has
zero length. I would like to filter out such attachments
without reading and it looks like the condition
"part.getInputStream().available() == 0" can be used for this purpose,
but it is not documented, that this method must return non-zero for non-empty
streams, so I decided to check here if I can use check or I must read
the stream to find out that the stream is empty.
Thanks in advance, Oleg.
===========================================================================
To unsubscribe, send email to ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".