Package org.jmule.core.sharingmanager

Examples of org.jmule.core.sharingmanager.Gap


        continue;

      }

      Gap f1 = (Gap) fg.toArray()[0];

      startPos = f1.getStart();

      endPos = startPos + blockSize;

      while (!((endPos >= f1.getStart()) && (endPos <= f1.getEnd())))

        endPos--;

      return new FileChunkRequest(startPos, endPos);
    } while (true);
View Full Code Here


      stop = true;

      for (int i = 0; i < gaps.size(); i++) {

        Gap g = (Gap) gaps.toArray()[i];

        for (int j = 0; j < fragment.size(); j++) {

          FileFragment ff = (FileFragment) fragment.toArray()[j];

          if ((ff.getStart() > g.getStart())
              && (ff.getEnd() < g.getEnd()))

            if (ff.getEnd() > g.getStart()
                && (ff.getEnd() < g.getEnd())) {

              gaps.remove(g);

              Gap g1 = new Gap(g.getStart(), ff.getStart() - 1);

              gaps.add(g1);

              Gap g2 = new Gap(ff.getEnd(), g.getEnd());

              gaps.add(g2);

              stop = false;

              break;

            }

          if ((ff.getStart() > g.getStart())
              && (ff.getEnd() < g.getEnd()))

            if (ff.getEnd() >= g.getEnd()) {

              gaps.remove(g);

              Gap g1 = new Gap(g.getStart(), ff.getStart() - 1);

              gaps.add(g1);

              stop = false;

              break;

            }

          if (ff.getStart() <= g.getStart())

            if (ff.getEnd() > g.getStart()
                && (ff.getEnd() < g.getEnd())) {

              gaps.remove(g);

              Gap g1 = new Gap(ff.getEnd(), g.getEnd());

              gaps.add(g1);

              stop = false;
View Full Code Here

TOP

Related Classes of org.jmule.core.sharingmanager.Gap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.