Package org.eclipse.jgit.util.io

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


  }

  void execute(final Socket sock) throws IOException,
      ServiceNotEnabledException, ServiceNotAuthorizedException {
    rawIn = new BufferedInputStream(sock.getInputStream());
    rawOut = new SafeBufferedOutputStream(sock.getOutputStream());

    if (0 < daemon.getTimeout())
      sock.setSoTimeout(daemon.getTimeout() * 1000);
    String cmd = new PacketLineIn(rawIn).readStringRaw();
    final int nul = cmd.indexOf('\0');
View Full Code Here


   *            the stream this instance outputs to. If not already buffered
   *            it will be automatically wrapped in a buffered stream.
   */
  protected PackIndexWriter(final OutputStream dst) {
    out = new DigestOutputStream(dst instanceof BufferedOutputStream ? dst
        : new SafeBufferedOutputStream(dst),
        Constants.newMessageDigest());
    tmp = new byte[4 + Constants.OBJECT_ID_LENGTH];
  }
View Full Code Here

      InputStream upIn = uploadPack.getInputStream();
      OutputStream upOut = uploadPack.getOutputStream();

      upIn = new BufferedInputStream(upIn);
      upOut = new SafeBufferedOutputStream(upOut);

      init(upIn, upOut);
      readAdvertisedRefs();
    }
View Full Code Here

      InputStream rpIn = receivePack.getInputStream();
      OutputStream rpOut = receivePack.getOutputStream();

      rpIn = new BufferedInputStream(rpIn);
      rpOut = new SafeBufferedOutputStream(rpOut);

      init(rpIn, rpOut);
      readAdvertisedRefs();
    }
View Full Code Here

   */
  private void writeHeadsFile(List<? extends ObjectId> heads, String filename)
      throws FileNotFoundException, IOException {
    File headsFile = new File(getDirectory(), filename);
    if (heads != null) {
      BufferedOutputStream bos = new SafeBufferedOutputStream(
          new FileOutputStream(headsFile));
      try {
        for (ObjectId id : heads) {
          id.copyTo(bos);
          bos.write('\n');
        }
      } finally {
        bos.close();
      }
    } else {
      FileUtils.delete(headsFile, FileUtils.SKIP_MISSING);
    }
  }
View Full Code Here

      // other direction (index, then pack file).
      //
      final String wt = "Put " + base.substring(0, 12); //$NON-NLS-1$
      OutputStream os = dest.writeFile(pathPack, monitor, wt + "..pack"); //$NON-NLS-1$
      try {
        os = new SafeBufferedOutputStream(os);
        writer.writePack(monitor, monitor, os);
      } finally {
        os.close();
      }

      os = dest.writeFile(pathIdx, monitor, wt + "..idx"); //$NON-NLS-1$
      try {
        os = new SafeBufferedOutputStream(os);
        writer.writeIndex(os);
      } finally {
        os.close();
      }
View Full Code Here

  }

  void execute(final Socket sock) throws IOException,
      ServiceNotEnabledException, ServiceNotAuthorizedException {
    rawIn = new BufferedInputStream(sock.getInputStream());
    rawOut = new SafeBufferedOutputStream(sock.getOutputStream());

    if (0 < daemon.getTimeout())
      sock.setSoTimeout(daemon.getTimeout() * 1000);
    String cmd = new PacketLineIn(rawIn).readStringRaw();
    final int nul = cmd.indexOf('\0');
View Full Code Here

      throws IOException {
    final long begin = files[0].getParentFile().lastModified();
    NullProgressMonitor m = NullProgressMonitor.INSTANCE;
    OutputStream out;

    out = new SafeBufferedOutputStream(new FileOutputStream(files[0]));
    try {
      pw.writePack(m, m, out);
    } finally {
      out.close();
    }

    out = new SafeBufferedOutputStream(new FileOutputStream(files[1]));
    try {
      pw.writeIndex(out);
    } finally {
      out.close();
    }
View Full Code Here

   */
  public void write() throws IOException {
    final LockFile tmp = myLock;
    requireLocked(tmp);
    try {
      writeTo(new SafeBufferedOutputStream(tmp.getOutputStream()));
    } catch (IOException err) {
      tmp.unlock();
      throw err;
    } catch (RuntimeException err) {
      tmp.unlock();
View Full Code Here

   * @param dst
   *            the output stream to which the index will be written.
   */
  public PackBitmapIndexWriterV1(final OutputStream dst) {
    out = new DigestOutputStream(dst instanceof BufferedOutputStream ? dst
        : new SafeBufferedOutputStream(dst),
        Constants.newMessageDigest());
    dataOutput = new SimpleDataOutput(out);
  }
View Full Code Here

TOP

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

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.