In my case, this problem had encountered when I tried to read the data stream to the buffer. The error was occured after second iteration of passing data stream. So how could it be?
Of course, data stream is about data to/from disk. So, I removed the file which previously written to the disk and it solved the problem.