Package org.tmatesoft.hg.internal.DataSerializer

Examples of org.tmatesoft.hg.internal.DataSerializer.ByteArraySerializer


      Nodeid fileRev = null;
      final boolean isNewFile = !df.exists();
      if (fp.first() != NO_REVISION && fp.second() == NO_REVISION && !isNewFile) {
        // compare file contents to see if anything has changed, and reuse old revision, if unchanged.
        // XXX ineffective, need better access to revision conten
        ByteArraySerializer bas = new ByteArraySerializer();
        bds.serialize(bas);
        final byte[] newContent = bas.toByteArray();
        // unless there's a way to reset DataSource, replace it with the content just read
        bds = new DataSerializer.ByteArrayDataSource(newContent);
        if (new ComparatorChannel(newContent).same(df, fp.first())) {
          fileRev = df.getRevision(fp.first());
        }
View Full Code Here


    }
    return lastEntryRevision;
  }
 
  private byte[] toByteArray(DataSource content) throws HgIOException, HgRuntimeException {
    ByteArraySerializer ba = new ByteArraySerializer();
    content.serialize(ba);
    return ba.toByteArray();
  }
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.internal.DataSerializer.ByteArraySerializer

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.