本文整理匯總了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);
}
示例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);
}
示例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');
}
}