After calling GridFSDownloadStreamImpl.skip() with a value larger than 2GB, e.g. 2306734080, the subsequent read() fails with ArrayIndexOutOfBoundsException.
It seems like this casting is missing some parentheses at line 117:
This is in effect:
But should have been:
The same applies here at line 126:
(Why float by the way, and not double?)