private static <S extends MessageSchema<S>> void processAvailData(TapeWriteStage<S> ss) { //only zero when we need to find the next block and have finished the previous if (0==ss.totalPrimaryCopy) { findStableCutPoint(ss); //we have established the point that we can read up to, this value is changed by the writer on the other side //get the start and stop locations for the copy //now find the point to start reading from, this is moved forward with each new read. if ((ss.totalPrimaryCopy = (ss.headPos - ss.cachedTail)) <= 0) { assert(ss.totalPrimaryCopy==0); return; //nothing to copy so come back later } setupBuffersToWriteFrom(ss); } copyToFile(ss); }