Package org.tmatesoft.hg.internal

Examples of org.tmatesoft.hg.internal.FilterByteChannel


    Check check = new Check();
    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();
        } catch (IOException ex) {
          repo.getSessionContext().getLog().dump(getClass(), Info, ex, null);
        }
        is = f.newInputChannel();
        fb.clear();
      }
      while (is.read(fb) != -1 && check.sameSoFar()) {
        fb.flip();
        filters.write(fb);
        fb.compact();
      }
      return check.ultimatelyTheSame();
    } catch (CancelledException ex) {
      repo.getSessionContext().getLog().dump(getClass(), Warn, ex, "Unexpected cancellation");
View Full Code Here


   */
  public void contentWithFilters(int fileRevisionIndex, ByteChannel sink) throws CancelledException, HgRuntimeException {
    if (fileRevisionIndex == WORKING_COPY) {
      workingCopy(sink); // pass un-mangled sink
    } else {
      content(fileRevisionIndex, new FilterByteChannel(sink, getRepo().getFiltersFromRepoToWorkingDir(getPath())));
    }
  }
View Full Code Here

TOP

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

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.