Skip to content

Commit

Permalink
For some JVMs, Sun elects to throw a IOException when an InputStreamR…
Browse files Browse the repository at this point in the history
…eader encounters a zero. For example, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4684515. This prevents JAMES IMAP from functioning correct when faced with some large emails. Most clients will simply call this method again if zero is returned so I think that this fix should reasonably safe but please review.

git-svn-id: https://svn.apache.org/repos/asf/james/mime4j/trunk@675781 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
itstechupnorth committed Jul 10, 2008
1 parent 671da21 commit 704df2a
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -115,7 +115,7 @@ public int read(byte[] b, int off, int len) throws IOException {
}
fillBuffer();
if (!hasData()) {
return 0;
return read(b, off, len);
}
int chunk = Math.min(len, limit - buffer.pos());
return buffer.read(b, off, chunk);
Expand Down

0 comments on commit 704df2a

Please sign in to comment.