Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.ObjectStream$Filter


      if (info.type != Constants.OBJ_BLOB)
        throw new IOException(MessageFormat.format(
            JGitText.get().unknownObjectType,
            Integer.valueOf(info.type)));

      ObjectStream cur = readCurs.open(obj, info.type).openStream();
      try {
        long sz = info.size;
        if (cur.getSize() != sz)
          throw new IOException(MessageFormat.format(
              JGitText.get().collisionOn, obj.name()));
        InputStream pck = inflate(Source.DATABASE, sz);
        while (0 < sz) {
          int n = (int) Math.min(readBuffer.length, sz);
          IO.readFully(cur, curBuffer, 0, n);
          IO.readFully(pck, readBuffer, 0, n);
          for (int i = 0; i < n; i++) {
            if (curBuffer[i] != readBuffer[i])
              throw new IOException(MessageFormat.format(JGitText
                  .get().collisionOn, obj.name()));
          }
          sz -= n;
        }
        pck.close();
      } finally {
        cur.close();
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.ObjectStream$Filter

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.