Package org.tmatesoft.hg.util

Examples of org.tmatesoft.hg.util.ByteChannel


      } else if (revision != null) {
        revToExtract = dataFile.getRevisionIndex(revision);
      } else {
        revToExtract = revisionIndex;
      }
      ByteChannel sinkWrap;
      if (getCancelSupport(null, false) == null) {
        // no command-specific cancel helper, no need for extra proxy
        // sink itself still may supply CS
        sinkWrap = sink;
      } else {
View Full Code Here


  public void serialize(final DataSerializer out) throws HgIOException, HgRuntimeException {
    final HgIOException failure[] = new HgIOException[1];
    try {
      // TODO #workingCopy API is very limiting, CancelledException is inconvenient,
      // and absence of HgIOException is very uncomfortable
      file.workingCopy(new ByteChannel() {
       
        public int write(ByteBuffer buffer) throws IOException {
          try {
            if (buffer.hasArray()) {
              out.write(buffer.array(), buffer.position(), buffer.remaining());
View Full Code Here

          throw new CancelledException();
        }
      }
    });
    try {
      cmd.execute(new ByteChannel() {
       
        public int write(ByteBuffer buffer) throws IOException, CancelledException {
          Assert.fail("Shall not get that far provided cancellation from command's CancelSupport is functional");
          return 0;
        }
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.util.ByteChannel

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.