Package org.tmatesoft.hg.internal

Examples of org.tmatesoft.hg.internal.Preview


    try {
      is = f.newInputChannel();
//      ByteBuffer fb = ByteBuffer.allocate(min(1 + data.length * 2 /*to fit couple of lines appended; never zero*/, 8192));
      ByteBuffer fb = ByteBuffer.allocate(8192); // FIXME temp fix to ensure big enough buffer for KeywordFilter
      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


    public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, DataAccess da) {
      try {
        prepare(revisionNumber, da); // XXX perhaps, prepare shall return DA (sliced, if needed)
        final ProgressSupport progressSupport = ProgressSupport.Factory.get(sink);
        ByteBuffer buf = ByteBuffer.allocate(actualLen > 8192 ? 8192 : actualLen);
        Preview p = Adaptable.Factory.getAdapter(sink, Preview.class, null);
        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

Related Classes of org.tmatesoft.hg.internal.Preview

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.