[ 
https://issues.apache.org/jira/browse/MIME4J-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634029#action_12634029
 ] 

Markus Wiederkehr commented on MIME4J-79:
-----------------------------------------

One more thing that you might want to consider is the general contract of 
InputStream / OutputStream. Although it is more slack than the one of Reader / 
Writer it seems to indicate that an IOException should be thrown in read() / 
write() once the stream has been closed. Closing an already closed stream 
should have no effect.

For example see InputStream.read(byte[]): "Throws: IOException - If the first 
byte cannot be read for any reason other than the end of the file, if the input 
stream has been closed, or if some other I/O error occurs."

> Message.writeTo() prematurely closes output stream if transfer encoding is 
> BASE64
> ---------------------------------------------------------------------------------
>
>                 Key: MIME4J-79
>                 URL: https://issues.apache.org/jira/browse/MIME4J-79
>             Project: JAMES Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>            Priority: Blocker
>             Fix For: 0.5
>
>         Attachments: Base64BugDemo.java, mime4j-base64.patch, 
> mime4j-close-codec.patch
>
>
> Entity.writeTo(OutputStream out, int mode) wraps the output stream in a 
> Base64OutputStream if the transfer encoding is BASE64. Later the wrapper 
> stream gets closed and (despite of a comment that says otherwise) the inner 
> stream gets closed, too.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to