|
Thanks for your understanding. I'm going to close this issue, as the current behavior is consistent with the documentation of InputStream.read, and with the actual behavior of other implementations of this method, in particular SocketInputStream.
|
|
Thanks for the comment. I can now see that this leaves quite some room for interpretation. Probably that's some sort of nit-picking, but currently the attempt is made to read up to one chunk size, in case 'len' is greater than the chunk size - instead of attempting to read 'len' bytes.
The issue I am seeing is that the caller can not know about the reason for less bytes being retrieved than requested. If the implementation of the stream would really attempt to read up to 'len' bytes, this would lead to less round trips in some cases.
As GridFS is designed to handle large documents, I would expect it to be able to fetch larger amounts of data without requiring manual assembly of the chunks. But I am aware of that this might be seen differently, so please close this issue if that's the case.
|