|
[
Permlink
| « Hide
]
Tim Ellison added a comment - 18/Mar/09 12:35 PM
Proposed patch for review.
Hmm the previous code is a little odd. This looks much better. +1
New patch (version 2) with more robust line detection.
I have a strong feeling that I have already implemented readFully() method for reading ("wrapping") manifests in
[1] https://issues.apache.org/jira/secure/attachment/12378468/ByteBuffer.java Yes, and that fast reflection path is still there in the InputStreamExposer. I modified it to throw an UnsupportedOperationException when the reflection 'trick' does not work rather than trying to read the entire stream, since the regression testcase passes in a stream that always returns a byte (an "infinite" stream).
The original code caught OutOfMemoryException and converted it to an IO exception, but that did not work on some machines. The new implementation, if it cannot use the fast reflection path, reads a chunk and looks for a CR/CR LF within a reasonable length of data, and throws the IO exception if it does not see one. Fixed in ARCHIVE and LUNI modules are r757150.
Tim, thanks for explaining! I was just checking svn annotate to understand what happened. I understand and support you fix.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||