I am wondering if anyone knows of a Java library that can take an input stream and spool it to disk, while allowing it to be read.
I am dealing with an issue where I need to stream very large files, and there is a server side timeout if nothing pulls from the stream in X amount of time.
Currently I read a chunk from the stream, process it, and then grab another chunk. This was working fine until I had an issue where the processing of a chunk of data from the stream took long enough for the stream to timeout.
I could fix this by downloading the stream fully before I process it, but that would mean I cannot start processing until the file is fully downloaded.
I am looking for a library that will download the input stream to disk, but allow the input stream to read while the download is happening. I would expect it to block if the input stream hits EOF but the download is still processing.
I could write this myself, but I was hoping someone had already gone through the trouble.