Package org.eclipse.jgit.util

Examples of org.eclipse.jgit.util.TemporaryBuffer


        e.smudgeRacilyClean();
      e.write(dos);
    }

    if (writeTree) {
      final TemporaryBuffer bb = new TemporaryBuffer.LocalFile();
      tree.write(tmp, bb);
      bb.close();

      NB.encodeInt32(tmp, 0, EXT_TREE);
      NB.encodeInt32(tmp, 4, (int) bb.length());
      dos.write(tmp, 0, 8);
      bb.writeTo(dos, null);
    }
    writeIndexChecksum = foot.digest();
    os.write(writeIndexChecksum);
    os.close();
  }
View Full Code Here


    if (!startedOutput) {
      // If output hasn't started yet, the entire thing fit into our
      // buffer. Try to use a proper Content-Length header, and also
      // deflate the response with gzip if it will be smaller.
      TemporaryBuffer out = this;

      if (256 < out.length() && acceptsGzipEncoding(req)) {
        TemporaryBuffer gzbuf = new TemporaryBuffer.Heap(LIMIT);
        try {
          GZIPOutputStream gzip = new GZIPOutputStream(gzbuf);
          try {
            out.writeTo(gzip, null);
          } finally {
            gzip.close();
          }
          if (gzbuf.length() < out.length()) {
            out = gzbuf;
            rsp.setHeader(HDR_CONTENT_ENCODING, ENCODING_GZIP);
          }
        } catch (IOException err) {
          // Most likely caused by overflowing the buffer, meaning
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.util.TemporaryBuffer

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.