Package org.eclipse.jgit.util.io

Examples of org.eclipse.jgit.util.io.CountingOutputStream


  private void writePack(DfsObjDatabase objdb, DfsPackDescription pack,
      PackWriter pw, ProgressMonitor pm) throws IOException {
    DfsOutputStream out = objdb.writePackFile(pack);
    try {
      CountingOutputStream cnt = new CountingOutputStream(out);
      pw.writePack(pm, pm, cnt);
      pack.setObjectCount(pw.getObjectCount());
      pack.setPackSize(cnt.getCount());
    } finally {
      out.close();
    }
  }
View Full Code Here


  private void writeIndex(DfsObjDatabase objdb, DfsPackDescription pack,
      PackWriter pw) throws IOException {
    DfsOutputStream out = objdb.writePackIndex(pack);
    try {
      CountingOutputStream cnt = new CountingOutputStream(out);
      pw.writeIndex(cnt);
      pack.setIndexSize(cnt.getCount());
    } finally {
      out.close();
    }
  }
View Full Code Here

      packIndex = PackIndex.read(buf.openInputStream());
    }

    DfsOutputStream os = db.writePackIndex(pack);
    try {
      CountingOutputStream cnt = new CountingOutputStream(os);
      if (buf != null)
        buf.writeTo(cnt, null);
      else
        index(cnt, packHash, list);
      pack.setIndexSize(cnt.getCount());
    } finally {
      os.close();
    }
    return packIndex;
  }
View Full Code Here

      out.close();
    }

    out = objdb.writeFile(pack, INDEX);
    try {
      CountingOutputStream cnt = new CountingOutputStream(out);
      pw.writeIndex(cnt);
      pack.addFileExt(INDEX);
      pack.setFileSize(INDEX, cnt.getCount());
      pack.setIndexVersion(pw.getIndexVersion());
    } finally {
      out.close();
    }

    if (pw.prepareBitmapIndex(pm)) {
      out = objdb.writeFile(pack, BITMAP_INDEX);
      try {
        CountingOutputStream cnt = new CountingOutputStream(out);
        pw.writeBitmapIndex(cnt);
        pack.addFileExt(BITMAP_INDEX);
        pack.setFileSize(BITMAP_INDEX, cnt.getCount());
      } finally {
        out.close();
      }
    }
View Full Code Here

      packIndex = PackIndex.read(buf.openInputStream());
    }

    DfsOutputStream os = db.writeFile(pack, INDEX);
    try {
      CountingOutputStream cnt = new CountingOutputStream(os);
      if (buf != null)
        buf.writeTo(cnt, null);
      else
        index(cnt, packHash, list);
      pack.addFileExt(INDEX);
      pack.setFileSize(INDEX, cnt.getCount());
    } finally {
      os.close();
    }
    return packIndex;
  }
View Full Code Here

  private static void writeIndex(DfsObjDatabase objdb,
      DfsPackDescription pack,
      PackWriter pw) throws IOException {
    DfsOutputStream out = objdb.writeFile(pack, INDEX);
    try {
      CountingOutputStream cnt = new CountingOutputStream(out);
      pw.writeIndex(cnt);
      pack.addFileExt(INDEX);
      pack.setFileSize(INDEX, cnt.getCount());
      pack.setIndexVersion(pw.getIndexVersion());
    } finally {
      out.close();
    }
  }
View Full Code Here

  private void writePack(DfsObjDatabase objdb, DfsPackDescription pack,
      PackWriter pw, ProgressMonitor pm) throws IOException {
    DfsOutputStream out = objdb.writePackFile(pack);
    try {
      CountingOutputStream cnt = new CountingOutputStream(out);
      pw.writePack(pm, pm, cnt);
      pack.setObjectCount(pw.getObjectCount());
      pack.setPackSize(cnt.getCount());
    } finally {
      out.close();
    }
  }
View Full Code Here

  private void writeIndex(DfsObjDatabase objdb, DfsPackDescription pack,
      PackWriter pw) throws IOException {
    DfsOutputStream out = objdb.writePackIndex(pack);
    try {
      CountingOutputStream cnt = new CountingOutputStream(out);
      pw.writeIndex(cnt);
      pack.setIndexSize(cnt.getCount());
    } finally {
      out.close();
    }
  }
View Full Code Here

      out.close();
    }

    out = objdb.writePackIndex(pack);
    try {
      CountingOutputStream cnt = new CountingOutputStream(out);
      pw.writeIndex(cnt);
      pack.setIndexSize(cnt.getCount());
    } finally {
      out.close();
    }

    PackWriter.Statistics stats = pw.getStatistics();
View Full Code Here

      packIndex = PackIndex.read(buf.openInputStream());
    }

    DfsOutputStream os = db.writePackIndex(pack);
    try {
      CountingOutputStream cnt = new CountingOutputStream(os);
      if (buf != null)
        buf.writeTo(cnt, null);
      else
        index(cnt, packHash, list);
      pack.setIndexSize(cnt.getCount());
    } finally {
      os.close();
    }
    return packIndex;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.util.io.CountingOutputStream

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.