Le 9 août 2012 à 10:28, Caleb James DeLisle a écrit :
For loading an attachment piecewise, OutputStreams are
not the only possible solution
but they are (in my analysis) the best.
I absolutely agree to this.
I find the usage of byte arrays should be even deprecated (still doable while staying in
4.x?).
I've been bragging about it from time to time... but could never contribute to it
indeed.
HttpClient does complain everytime you try to allocate entities in byte-arrays. Maybe
that's too explicit but that's effective to force the developer into finding
alternate solutions.
I've seen things slightly more explicit than outputstream and inputstream floating
around, things related to FileUpload if I remember well. In particular, I think it is best
practice to carry the length as far away into the API as possible thus allowing the best
buffering and storage strategy.
Paul