Examples of preview()


Examples of org.tmatesoft.hg.internal.NewlineFilter.preview()

    byte[] i2 = "\n\r\nDEF\r\n".getBytes();
    NewlineFilter nlFilter = NewlineFilter.createWin2Nix(false);
    ByteBuffer input = ByteBuffer.allocate(i1.length + i2.length);
    ByteBuffer res = ByteBuffer.allocate(i1.length + i2.length); // at most of the original size
    nlFilter.preview(ByteBuffer.wrap(i1));
    nlFilter.preview(ByteBuffer.wrap(i2));
    //
    input.put(i1).flip();
    res.put(nlFilter.filter(input));
    Assert.assertTrue("Unpocessed chars shall be left in input buffer", input.remaining() > 0);
    input.compact();
View Full Code Here

Examples of org.tmatesoft.hg.internal.NewlineFilter.preview()

    nlFilter = NewlineFilter.createWin2Nix(false);
    res.clear();
    input.clear();
    input.put(i1).put("\r\r\r".getBytes()).flip();
    // preview requred
    nlFilter.preview(input);
    nlFilter.preview(ByteBuffer.wrap(i2));
    // input.position(0); correctly written preview shall not affect buffer position
    //
    res.put(nlFilter.filter(input));
    Assert.assertTrue("Unpocessed chars shall be left in input buffer", input.remaining() > 0);
View Full Code Here

Examples of org.tmatesoft.hg.internal.NewlineFilter.preview()

    res.clear();
    input.clear();
    input.put(i1).put("\r\r\r".getBytes()).flip();
    // preview requred
    nlFilter.preview(input);
    nlFilter.preview(ByteBuffer.wrap(i2));
    // input.position(0); correctly written preview shall not affect buffer position
    //
    res.put(nlFilter.filter(input));
    Assert.assertTrue("Unpocessed chars shall be left in input buffer", input.remaining() > 0);
    input.compact();
View Full Code Here

Examples of org.tmatesoft.hg.internal.Preview.preview()

      FilterByteChannel filters = new FilterByteChannel(check, repo.getFiltersFromWorkingDirToRepo(p));
      Preview preview = Adaptable.Factory.getAdapter(filters, Preview.class, null);
      if (preview != null) {
        while (is.read(fb) != -1) {
          fb.flip();
          preview.preview(fb);
          fb.clear();
        }
        // reset channel to read once again
        try {
          is.close();
View Full Code Here

Examples of org.tmatesoft.hg.internal.Preview.preview()

        if (p != null) {
          progressSupport.start(2 * da.length());
          while (!da.isEmpty()) {
            checkCancelled();
            da.readBytes(buf);
            p.preview(buf);
            buf.clear();
          }
          da.reset();
          prepare(revisionNumber, da);
          progressSupport.worked(da.length());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.