當前位置: 首頁>>代碼示例>>Java>>正文


Java SafeBufferedOutputStream類代碼示例

本文整理匯總了Java中org.eclipse.jgit.util.io.SafeBufferedOutputStream的典型用法代碼示例。如果您正苦於以下問題:Java SafeBufferedOutputStream類的具體用法?Java SafeBufferedOutputStream怎麽用?Java SafeBufferedOutputStream使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SafeBufferedOutputStream類屬於org.eclipse.jgit.util.io包,在下文中一共展示了SafeBufferedOutputStream類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import org.eclipse.jgit.util.io.SafeBufferedOutputStream; //導入依賴的package包/類
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');
	if (nul >= 0) {
		// Newer clients hide a "host" header behind this byte.
		// Currently we don't use it for anything, so we ignore
		// this portion of the command.
		//
		cmd = cmd.substring(0, nul);
	}

	final GitDaemonService srv = getDaemon().matchService(cmd);
	if (srv == null)
		return;
	sock.setSoTimeout(0);
	srv.execute(this, cmd);
}
 
開發者ID:warpfork,項目名稱:gitblit,代碼行數:24,代碼來源:GitDaemonClient.java

示例2: execute

import org.eclipse.jgit.util.io.SafeBufferedOutputStream; //導入依賴的package包/類
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');
    if (nul >= 0) {
        // Newer clients hide a "host" header behind this byte.
        // Currently we don't use it for anything, so we ignore
        // this portion of the command.
        //
        cmd = cmd.substring(0,
                            nul);
    }

    final DaemonService srv = getDaemon().matchService(cmd);
    if (srv == null) {
        return;
    }
    sock.setSoTimeout(0);
    srv.execute(this,
                cmd);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:28,代碼來源:DaemonClient.java

示例3: writeFile

import org.eclipse.jgit.util.io.SafeBufferedOutputStream; //導入依賴的package包/類
private void writeFile (File file, ObjectId id) throws IOException {
    try (BufferedOutputStream bos = new SafeBufferedOutputStream(new FileOutputStream(file))) {
        id.copyTo(bos);
        bos.write('\n');
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:7,代碼來源:CherryPickCommand.java


注:本文中的org.eclipse.jgit.util.io.SafeBufferedOutputStream類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。