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


Java FileDescriptor.out方法代碼示例

本文整理匯總了Java中java.io.FileDescriptor.out方法的典型用法代碼示例。如果您正苦於以下問題:Java FileDescriptor.out方法的具體用法?Java FileDescriptor.out怎麽用?Java FileDescriptor.out使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.io.FileDescriptor的用法示例。


在下文中一共展示了FileDescriptor.out方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initPhase1

import java.io.FileDescriptor; //導入方法依賴的package包/類
/**
 * Initialize the system class.  Called after thread initialization.
 */
private static void initPhase1() {

    // VM might invoke JNU_NewStringPlatform() to set those encoding
    // sensitive properties (user.home, user.name, boot.class.path, etc.)
    // during "props" initialization, in which it may need access, via
    // System.getProperty(), to the related system encoding property that
    // have been initialized (put into "props") at early stage of the
    // initialization. So make sure the "props" is available at the
    // very beginning of the initialization and all system properties to
    // be put into it directly.
    props = new Properties();
    initProperties(props);  // initialized by the VM

    // There are certain system configurations that may be controlled by
    // VM options such as the maximum amount of direct memory and
    // Integer cache size used to support the object identity semantics
    // of autoboxing.  Typically, the library will obtain these values
    // from the properties set by the VM.  If the properties are for
    // internal implementation use only, these properties should be
    // removed from the system properties.
    //
    // See java.lang.Integer.IntegerCache and the
    // VM.saveAndRemoveProperties method for example.
    //
    // Save a private copy of the system properties object that
    // can only be accessed by the internal implementation.  Remove
    // certain system properties that are not intended for public access.
    VM.saveAndRemoveProperties(props);

    lineSeparator = props.getProperty("line.separator");
    VersionProps.init();

    FileInputStream fdIn = new FileInputStream(FileDescriptor.in);
    FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out);
    FileOutputStream fdErr = new FileOutputStream(FileDescriptor.err);
    setIn0(new BufferedInputStream(fdIn));
    setOut0(newPrintStream(fdOut, props.getProperty("sun.stdout.encoding")));
    setErr0(newPrintStream(fdErr, props.getProperty("sun.stderr.encoding")));

    // Setup Java signal handlers for HUP, TERM, and INT (where available).
    Terminator.setup();

    // Initialize any miscellaneous operating system settings that need to be
    // set for the class libraries. Currently this is no-op everywhere except
    // for Windows where the process-wide error mode is set before the java.io
    // classes are used.
    VM.initializeOSEnvironment();

    // The main thread is not added to its thread group in the same
    // way as other threads; we must do it ourselves here.
    Thread current = Thread.currentThread();
    current.getThreadGroup().add(current);

    // register shared secrets
    setJavaLangAccess();

    // Subsystems that are invoked during initialization can invoke
    // VM.isBooted() in order to avoid doing things that should
    // wait until the VM is fully initialized. The initialization level
    // is incremented from 0 to 1 here to indicate the first phase of
    // initialization has completed.
    // IMPORTANT: Ensure that this remains the last initialization action!
    VM.initLevel(1);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:68,代碼來源:System.java

示例2: isScreen

import java.io.FileDescriptor; //導入方法依賴的package包/類
/**
 * Determine if output goes to the screen.
 * 
 * @return <code>true</code> if output is directed to STOUT or STDERR.
 */
public boolean isScreen() {
	return fd == FileDescriptor.out || fd == FileDescriptor.err;
}
 
開發者ID:paudano,項目名稱:kestrel,代碼行數:9,代碼來源:StreamableOutput.java


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