private static boolean processAvailData(TapeWriteStage ss) {
    int byteHeadPos;
    long headPos;

    // get the new head position
    byteHeadPos = RingBuffer.bytesHeadPosition(ss.source);
    headPos = RingBuffer.headPosition(ss.source);
    while (byteHeadPos != RingBuffer.bytesHeadPosition(ss.source)
        || headPos != RingBuffer.headPosition(ss.source)) {
      byteHeadPos = RingBuffer.bytesHeadPosition(ss.source);
      headPos = RingBuffer.headPosition(ss.source);
    }

    // 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.
    int pMask = ss.source.mask;
    long tempTail = RingBuffer.tailPosition(ss.source);
    int primaryTailPos = pMask & (int) tempTail;
    long totalPrimaryCopy = (headPos - tempTail);
    if (totalPrimaryCopy <= 0) {
      assert (totalPrimaryCopy == 0);
      return false; // nothing to copy so come back later
    }

    int bMask = ss.source.byteMask;
    int tempByteTail = RingBuffer.bytesTailPosition(ss.source);
    int byteTailPos = bMask & tempByteTail;
    int totalBytesCopy = (bMask & byteHeadPos) - byteTailPos;
    if (totalBytesCopy < 0) {
      totalBytesCopy += (bMask + 1);
    }

    // now do the copies
    if (doingCopy(ss, byteTailPos, primaryTailPos, (int) totalPrimaryCopy, totalBytesCopy)) {

      // TODO: play back file with those cunks into indexer to do it after the fact

      // release tail so data can be written
      int i = RingBuffer.BYTES_WRAP_MASK & (tempByteTail + totalBytesCopy);
      RingBuffer.setBytesWorkingTail(ss.source, i);
      RingBuffer.setBytesTail(ss.source, i);
      RingBuffer.publishWorkingTailPosition(ss.source, tempTail + totalPrimaryCopy);

      return true;
    }
    return false; // finished all the copy  for now
  }