home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / System.java < prev    next >
Text File  |  1998-01-23  |  25KB  |  605 lines

  1. /*
  2.  * @(#)System.java    1.72 97/11/14
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. package java.lang;
  24.  
  25. import java.io.*;
  26. import java.util.Properties;
  27. import java.util.StringTokenizer;
  28.  
  29. /**
  30.  * The <code>System</code> class contains several useful class fields 
  31.  * and methods. It cannot be instantiated. 
  32.  * <p>
  33.  * Among the facilities provided by the <code>System</code> class 
  34.  * are standard input, standard output, and error output streams; 
  35.  * access to externally defined "properties"; a means of 
  36.  * loading files and libraries; and a utility method for quickly 
  37.  * copying a portion of an array. 
  38.  *
  39.  * @author  Arthur van Hoff 
  40.  * @version 1.72, 11/14/97
  41.  * @since   JDK1.0
  42.  */
  43. public final
  44. class System {
  45.     /** Don't let anyone instantiate this class */
  46.     private System() {
  47.     }
  48.  
  49.     /**
  50.      * The "standard" input stream. This stream is already 
  51.      * open and ready to supply input data. Typically this stream 
  52.      * corresponds to keyboard input or another input source specified by 
  53.      * the host environment or user. 
  54.      *
  55.      * @since   JDK1.0
  56.      */
  57.     public final static InputStream in = nullInputStream();
  58.  
  59.     /**
  60.      * The "standard" output stream. This stream is already 
  61.      * open and ready to accept output data. Typically this stream 
  62.      * corresponds to display output or another output destination 
  63.      * specified by the host environment or user. 
  64.      * <p>
  65.      * For simple stand-alone Java applications, a typical way to write 
  66.      * a line of output data is: 
  67.      * <ul><code>System.out.println(data)</code></ul>
  68.      * <p>
  69.      * See the <code>println</code> methods in class <code>PrintStream</code>. 
  70.      *
  71.      * @see     java.io.PrintStream#println()
  72.      * @see     java.io.PrintStream#println(boolean)
  73.      * @see     java.io.PrintStream#println(char)
  74.      * @see     java.io.PrintStream#println(char[])
  75.      * @see     java.io.PrintStream#println(double)
  76.      * @see     java.io.PrintStream#println(float)
  77.      * @see     java.io.PrintStream#println(int)
  78.      * @see     java.io.PrintStream#println(long)
  79.      * @see     java.io.PrintStream#println(java.lang.Object)
  80.      * @see     java.io.PrintStream#println(java.lang.String)
  81.      * @since   JDK1.0
  82.      */
  83.     public final static PrintStream out = nullPrintStream();
  84.  
  85.     /**
  86.      * The "standard" error output stream. This stream is already 
  87.      * open and ready to accept output data. 
  88.      * <p>
  89.      * Typically this stream corresponds to display output or another 
  90.      * output destination specified by the host environment or user. By 
  91.      * convention, this output stream is used to display error messages 
  92.      * or other information that should come to the immediate attention 
  93.      * of a user even if the principal output stream, the value of the 
  94.      * variable <code>out</code>, has been redirected to a file or other 
  95.      * destination that is typically not continuously monitored. 
  96.      *
  97.      * @since   JDK1.0
  98.      */
  99.     public final static PrintStream err = nullPrintStream();
  100.  
  101.     /* The security manager for the system.
  102.      */
  103.     private static SecurityManager security = null;
  104.  
  105.     /**
  106.      * Reassigns the "standard" input stream.
  107.      *
  108.      * @since   JDK1.1
  109.      */
  110.     public static void setIn(InputStream in) {
  111.     checkIO();
  112.     setIn0(in);
  113.     }
  114.  
  115.     /**
  116.      * Reassigns the "standard" output stream.
  117.      *
  118.      * @since   JDK1.1
  119.      */
  120.     public static void setOut(PrintStream out) {
  121.     checkIO();
  122.     setOut0(out);
  123.     }
  124.  
  125.     /**
  126.      * Reassigns the "standard" error output stream.
  127.      *
  128.      * @since   JDK1.1
  129.      */
  130.     public static void setErr(PrintStream err) {
  131.     checkIO();
  132.     setErr0(err);
  133.     }
  134.  
  135.     private static void checkIO() {
  136.     if (security != null) {
  137.         /* REMIND: this should have its own security check call */
  138.         security.checkExec("setio");
  139.     }
  140.     }
  141.  
  142.     private static native void setIn0(InputStream in);
  143.     private static native void setOut0(PrintStream out);
  144.     private static native void setErr0(PrintStream err);
  145.  
  146.     /**
  147.      * Sets the System security.
  148.      * If a security manager has already been established for the 
  149.      * currently running Java application, a <code>SecurityException</code> 
  150.      * is thrown. Otherwise, the argument is established as the current 
  151.      * security manager. If the argument is <code>null</code> and no 
  152.      * security manager has been established, then no action is taken and 
  153.      * the method simply returns. 
  154.      *
  155.      * @param      s   the security manager.
  156.      * @exception  SecurityException  if the security manager has already
  157.      *               been set.
  158.      * @since   JDK1.0
  159.      */
  160.     public static void setSecurityManager(SecurityManager s) {
  161.     if (security != null) {
  162.         throw new SecurityException("SecurityManager already set");
  163.     }
  164.     security = s;
  165.     }
  166.  
  167.     /**
  168.      * Gets the system security interface.
  169.      *
  170.      * @return  if a security manager has already been established for the
  171.      *          current application, then that security manager is returned;
  172.      *          otherwise, <code>null</code> is returned.
  173.      * @since   JDK1.0
  174.      */
  175.     public static SecurityManager getSecurityManager() {
  176.     return security;
  177.     }
  178.  
  179.     /**
  180.      * Returns the current time in milliseconds.
  181.      * <p>
  182.      * See the description of the class <code>Date</code> for a discussion 
  183.      * of slight discrepancies that may arise between "computer 
  184.      * time" and coordinated universal time (UTC). 
  185.      *
  186.      * @return  the difference, measured in milliseconds, between the current
  187.      *          time and midnight, January 1, 1970 UTC.
  188.      * @see     java.util.Date
  189.      * @since   JDK1.0
  190.      */
  191.     public static native long currentTimeMillis();
  192.  
  193.     /** 
  194.      * Copies an array from the specified source array, beginning at the
  195.      * specified position, to the specified position of the destination array.
  196.      * A subsequence of array components are copied from the source 
  197.      * array referenced by <code>src</code> to the destination array 
  198.      * referenced by <code>dst</code>. The number of components copied is 
  199.      * equal to the <code>length</code> argument. The components at 
  200.      * positions <code>srcOffset</code> through 
  201.      * <code>srcOffset+length-1</code> in the source array are copied into 
  202.      * positions <code>dstOffset</code> through 
  203.      * <code>dstOffset+length-1</code>, respectively, of the destination 
  204.      * array. 
  205.      * <p>
  206.      * If the <code>src</code> and <code>dst</code> arguments refer to the 
  207.      * same array object, then the copying is performed as if the 
  208.      * components at positions <code>srcOffset</code> through 
  209.      * <code>srcOffset+length-1</code> were first copied to a temporary 
  210.      * array with <code>length</code> components and then the contents of 
  211.      * the temporary array were copied into positions 
  212.      * <code>dstOffset</code> through <code>dstOffset+length-1</code> of the 
  213.      * argument array. 
  214.      * <p>
  215.      * If any of the following is true, an 
  216.      * <code>ArrayStoreException</code> is thrown and the destination is 
  217.      * not modified: 
  218.      * <ul>
  219.      * <li>The <code>src</code> argument refers to an object that is not an 
  220.      *     array. 
  221.      * <li>The <code>dst</code> argument refers to an object that is not an 
  222.      *     array. 
  223.      * <li>The <code>src</code> argument and <code>dst</code> argument refer to 
  224.      *     arrays whose component types are different primitive types. 
  225.      * <li>The <code>src</code> argument refers to an array with a primitive 
  226.      *     component type and the <code>dst</code> argument refers to an array 
  227.      *     with a reference component type. 
  228.      * <li>The <code>src</code> argument refers to an array with a reference 
  229.      *     component type and the <code>dst</code> argument refers to an array 
  230.      *     with a primitive component type. 
  231.      * </ul>
  232.      * <p>
  233.      * Otherwise, if any of the following is true, an 
  234.      * <code>ArrayIndexOutOfBoundsException</code> is 
  235.      * thrown and the destination is not modified: 
  236.      * <ul>
  237.      * <li>The <code>srcOffset</code> argument is negative. 
  238.      * <li>The <code>dstOffset</code> argument is negative. 
  239.      * <li>The <code>length</code> argument is negative. 
  240.      * <li><code>srcOffset+length</code> is greater than 
  241.      *     <code>src.length</code>, the length of the source array. 
  242.      * <li><code>dstOffset+length</code> is greater than 
  243.      *     <code>dst.length</code>, the length of the destination array. 
  244.      * </ul>
  245.      * <p>
  246.      * Otherwise, if any actual component of the source array from 
  247.      * position <code>srcOffset</code> through 
  248.      * <code>srcOffset+length-1</code> cannot be converted to the component 
  249.      * type of the destination array by assignment conversion, an 
  250.      * <code>ArrayStoreException</code> is thrown. In this case, let 
  251.      * <b><i>k</i></b> be the smallest nonnegative integer less than 
  252.      * length such that <code>src[srcOffset+</code><i>k</i><code>]</code> 
  253.      * cannot be converted to the component type of the destination 
  254.      * array; when the exception is thrown, source array components from 
  255.      * positions <code>srcOffset</code> through
  256.      * <code>srcOffset+</code><i>k</i><code>-1</code> 
  257.      * will already have been copied to destination array positions 
  258.      * <code>dstOffset</code> through
  259.      * <code>dstOffset+</code><i>k</I><code>-1</code> and no other 
  260.      * positions of the destination array will have been modified. 
  261.      *
  262.      * @param      src:      the source array.
  263.      * @param      srcpos    start position in the source array.
  264.      * @param      dest      the destination array.
  265.      * @param      destpos   start position in the destination data.
  266.      * @param      length    the number of array elements to be copied.
  267.      * @exception  ArrayIndexOutOfBoundsException  if copying would cause
  268.      *               access of data outside array bounds.
  269.      * @exception  ArrayStoreException  if an element in the <code>src</code>
  270.      *               array could not be stored into the <code>dest</code> array
  271.      *               because of a type mismatch.
  272.      * @since      JDK1.0
  273.      */
  274.     public static native void arraycopy(Object src, int src_position,
  275.                                         Object dst, int dst_position,
  276.                                         int length);
  277.  
  278.     /**
  279.      * Returns the same hashcode for the given object as
  280.      * would be returned by the default method hashCode(),
  281.      * whether or not the given object's class overrides
  282.      * hashCode().
  283.      * The hashcode for the null reference is zero.
  284.      *
  285.      * @since   JDK1.1
  286.      */
  287.     public static native int identityHashCode(Object x);
  288.  
  289.     /**
  290.      * System properties. The following properties are guaranteed to be defined:
  291.      * <dl>
  292.      * <dt>java.version        <dd>Java version number
  293.      * <dt>java.vendor        <dd>Java vendor specific string
  294.      * <dt>java.vendor.url    <dd>Java vendor URL
  295.      * <dt>java.home        <dd>Java installation directory
  296.      * <dt>java.class.version    <dd>Java class version number
  297.      * <dt>java.class.path    <dd>Java classpath
  298.      * <dt>os.name        <dd>Operating System Name
  299.      * <dt>os.arch        <dd>Operating System Architecture
  300.      * <dt>os.version        <dd>Operating System Version
  301.      * <dt>file.separator    <dd>File separator ("/" on Unix)
  302.      * <dt>path.separator    <dd>Path separator (":" on Unix)
  303.      * <dt>line.separator    <dd>Line separator ("\n" on Unix)
  304.      * <dt>user.name        <dd>User account name
  305.      * <dt>user.home        <dd>User home directory
  306.      * <dt>user.dir        <dd>User's current working directory
  307.      * </dl>
  308.      */
  309.  
  310.     private static Properties props;
  311.     private static native Properties initProperties(Properties props);
  312.  
  313.     /**
  314.      * Determines the current system properties. 
  315.      * <p>
  316.      * If there is a security manager, its 
  317.      * <code>checkPropertiesAccess</code> method is called with no 
  318.      * arguments. This may result in a security exception. 
  319.      * <p>
  320.      * The current set of system properties is returned as a 
  321.      * <code>Properties</code> object. If there is no current set of 
  322.      * system properties, a set of system properties is first created and 
  323.      * initialized. 
  324.      * <p>
  325.      * This set of system properties always includes values for the 
  326.      * following keys: 
  327.      * <table>
  328.      * <tr><th>Key</th>
  329.      *     <th>Description of Associated Value</th></tr>
  330.      * <tr><td><code>java.version</code></td>
  331.      *     <td>Java version number</td></tr>
  332.      * <tr><td><code>java.vendor</code></td>
  333.      *     <td>Java vendor-specific string</td></tr>
  334.      * <tr><td><code>java.vendor.url</code></td>
  335.      *     <td>Java vendor URL</td></tr>
  336.      * <tr><td><code>java.home</code></td>
  337.      *     <td>Java installation directory</td></tr>
  338.      * <tr><td><code>java.class.version</code></td>
  339.      *     <td>Java class format version number</td></tr>
  340.      * <tr><td><code>java.class.path</code></td>
  341.      *     <td>Java class path</td></tr>
  342.      * <tr><td><code>os.name</code></td>
  343.      *     <td>Operating system name</td></tr>
  344.      * <tr><td><code>os.arch</code></td>
  345.      *     <td>Operating system architecture</td></tr>
  346.      * <tr><td><code>os.version</code></td>
  347.      *     <td>Operating system version</td></tr>
  348.      * <tr><td><code>file.separator</code></td>
  349.      *     <td>File separator ("/" on UNIX)</td></tr>
  350.      * <tr><td><code>path.separator</code></td>
  351.      *     <td>Path separator (":" on UNIX)</td></tr>
  352.      * <tr><td><code>line.separator</code></td>
  353.      *     <td>Line separator ("\n" on UNIX)</td></tr>
  354.      * <tr><td><code>user.name</code></td>
  355.      *     <td>User's account name</td></tr>
  356.      * <tr><td><code>user.home</code></td>
  357.      *     <td>User's home directory</td></tr>
  358.      * <tr><td><code>user.dir</code></td>
  359.      *     <td>User's current working directory</td></tr>
  360.      * </table>
  361.      *
  362.      * @exception  SecurityException  if the current thread cannot access the
  363.      *               system properties.
  364.      * @see        java.lang.SecurityException
  365.      * @see        java.lang.SecurityManager#checkPropertiesAccess()
  366.      * @see        java.util.Properties
  367.      * @since      JDK1.0
  368.      */
  369.     public static Properties getProperties() {
  370.     if (security != null) {
  371.         security.checkPropertiesAccess();
  372.     }
  373.     return props;
  374.     }
  375.  
  376.     /**
  377.      * Sets the system properties to the <code>Properties</code> 
  378.      * argument. 
  379.      * <p>
  380.      * First, if there is a security manager, its 
  381.      * <code>checkPropertiesAccess</code> method is called with no 
  382.      * arguments. This may result in a security exception. 
  383.      * <p>
  384.      * The argument becomes the current set of system properties for use 
  385.      * by the <code>getProperty</code> method. If the argument is 
  386.      * <code>null</code>, then the current set of system properties is 
  387.      * forgotten. 
  388.      *
  389.      * @param      props   the new system properties.
  390.      * @exception  SecurityException  if the current thread cannot set the
  391.      *               system properties.
  392.      * @see        java.lang.SecurityException
  393.      * @see        java.lang.SecurityManager#checkPropertiesAccess()
  394.      * @since      JDK1.0
  395.      */
  396.     public static void setProperties(Properties props) {
  397.     if (security != null) {
  398.         security.checkPropertiesAccess();
  399.     }
  400.     System.props = props;
  401.     }
  402.     
  403.     /**
  404.      * Gets the system property indicated by the specified key. 
  405.      * <p>
  406.      * First, if there is a security manager, its 
  407.      * <code>checkPropertyAccess</code> method is called with the key as 
  408.      * its argument. This may result in a system exception. 
  409.      * <p>
  410.      * If there is no current set of system properties, a set of system 
  411.      * properties is first created and initialized in the same manner as 
  412.      * for the <code>getProperties</code> method. 
  413.      *
  414.      * @param      key   the name of the system property.
  415.      * @return     the string value of the system property,
  416.      *             or <code>null</code> if there is no property with that key.
  417.      * @exception  SecurityException  if the current thread cannot access the
  418.      *               system properties or the specified property.
  419.      * @see        java.lang.SecurityException
  420.      * @see        java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
  421.      * @see        java.lang.System#getProperties()
  422.      * @since      JDK1.0
  423.      */
  424.     public static String getProperty(String key) {
  425.     if (security != null) {
  426.         security.checkPropertyAccess(key);
  427.     }
  428.     return props.getProperty(key);
  429.     }
  430.     
  431.     /**
  432.      * Gets the system property indicated by the specified key. 
  433.      * <p>
  434.      * First, if there is a security manager, its 
  435.      * <code>checkPropertyAccess</code> method is called with the 
  436.      * <code>key</code> as its argument. 
  437.      * <p>
  438.      * If there is no current set of system properties, a set of system 
  439.      * properties is first created and initialized in the same manner as 
  440.      * for the <code>getProperties</code> method. 
  441.      *
  442.      * @param      key   the name of the system property.
  443.      * @param      def   a default value.
  444.      * @return     the string value of the system property,
  445.      *             or the default value if there is no property with that key.
  446.      * @exception  SecurityException  if the current thread cannot access the
  447.      *               system properties or the specified property.
  448.      * @see        java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
  449.      * @see        java.lang.System#getProperties()
  450.      * @since      JDK1.0
  451.      */
  452.     public static String getProperty(String key, String def) {
  453.     if (security != null) {
  454.         security.checkPropertyAccess(key); 
  455.     }
  456.     return props.getProperty(key, def);
  457.     }
  458.     
  459.     /**
  460.      * Gets an environment variable. An environment variable is a
  461.      * system dependent external variable that has a string value.
  462.      * 
  463.      * @param   the name of the environment variable.
  464.      * @return     the value of the variable, or null if the variable is
  465.      *        not defined.
  466.      * @since   JDK1.0
  467.      * @deprecated
  468.      */
  469.     public static String getenv(String name) {
  470.     throw new Error("getenv no longer supported, use properties and -D instead: " + name);
  471.     }
  472.  
  473.     /**
  474.      * Terminates the currently running Java Virtual Machine. The 
  475.      * argument serves as a status code; by convention, a nonzero status 
  476.      * code indicates abnormal termination. 
  477.      * <p>
  478.      * This method calls the <code>exit</code> method in class 
  479.      * <code>Runtime</code>. This method never returns normally. 
  480.      *
  481.      * @param      status   exit status.
  482.      * @exception  SecurityException  if the current thread cannot exit with
  483.      *               the specified status.
  484.      * @see        java.lang.Runtime#exit(int)
  485.      * @since      JDK1.0
  486.      */
  487.     public static void exit(int status) {
  488.     Runtime.getRuntime().exit(status);
  489.     }
  490.  
  491.     /**
  492.      * Runs the garbage collector.
  493.      * <p>
  494.      * Calling the <code>gc</code> method suggests that the Java Virtual 
  495.      * Machine expend effort toward recycling unused objects in order to 
  496.      * make the memory they currently occupy available for quick reuse. 
  497.      * When control returns from the method call, the Java Virtual 
  498.      * Machine has made a best effort to reclaim space from all unused 
  499.      * objects.
  500.      *
  501.      * @see     java.lang.Runtime#gc()
  502.      * @since   JDK1.0
  503.      */
  504.     public static void gc() {
  505.     Runtime.getRuntime().gc();
  506.     }
  507.  
  508.     /**
  509.      * Runs the finalization methods of any objects pending finalization.
  510.      * <p>
  511.      * Calling this method suggests that the Java Virtual Machine expend 
  512.      * effort toward running the <code>finalize</code> methods of objects 
  513.      * that have been found to be discarded but whose <code>finalize</code> 
  514.      * methods have not yet been run. When control returns from the 
  515.      * method call, the Java Virtual Machine has made a best effort to 
  516.      * complete all outstanding finalizations. 
  517.      *
  518.      * @see     java.lang.Runtime#runFinalization()
  519.      * @since   JDK1.0
  520.      */
  521.     public static void runFinalization() {
  522.     Runtime.getRuntime().runFinalization();
  523.     }
  524.  
  525.     /**
  526.      * Enable or disable finalization on exit; doing so specifies that the
  527.      * finalizers of all objects that have finalizers that have not yet been
  528.      * automatically invoked are to be run before the Java runtime exits.
  529.      * By default, finalization on exit is disabled.
  530.      * @see     java.lang.Runtime#exit(int)
  531.      * @see     java.lang.Runtime#gc()
  532.      * @since   JDK1.1
  533.      */
  534.     public static void runFinalizersOnExit(boolean value) {
  535.     Runtime.getRuntime().runFinalizersOnExit(value);
  536.     }
  537.  
  538.     /**
  539.      * Loads the specified filename as a dynamic library. The filename 
  540.      * argument must be a complete pathname. 
  541.      * <p>
  542.      * This method calls the <code>load</code> method in class 
  543.      * <code>Runtime. </code> 
  544.      *
  545.      * @param      filename   the file to load.
  546.      * @exception  SecurityException  if the current thread cannot load the
  547.      *               specified dynamic library.
  548.      * @exception  UnsatisfiedLinkError  if the file does not exist.
  549.      * @see        java.lang.Runtime#load(java.lang.String)
  550.      * @since      JDK1.0
  551.      */
  552.     public static void load(String filename) {
  553.     Runtime.getRuntime().load(filename);
  554.     }
  555.  
  556.     /**
  557.      * Loads the system library specified by the <code>libname</code> 
  558.      * argument. The manner in which a library name is mapped to the 
  559.      * actual system library is system dependent. 
  560.      *
  561.      * @param      libname   the name of the library.
  562.      * @exception  SecurityException  if the current thread cannot load the
  563.      *               specified dynamic library.
  564.      * @exception  UnsatisfiedLinkError  if the library does not exist.
  565.      * @see        java.lang.Runtime#loadLibrary(java.lang.String)
  566.      * @since      JDK1.0
  567.      */
  568.     public static void loadLibrary(String libname) {
  569.     Runtime.getRuntime().loadLibrary(libname);
  570.     }
  571.  
  572.     /**
  573.      * The following two methods exist because in, out, and err must be
  574.      * initialized to null.  The compiler, however, cannot be permitted to
  575.      * inline access to them, since they are later set to more sensible values
  576.      * by initializeSystemClass().
  577.      */
  578.     private static InputStream nullInputStream() throws NullPointerException {
  579.     if (currentTimeMillis() > 0)
  580.         return null;
  581.     throw new NullPointerException();
  582.     }
  583.  
  584.     private static PrintStream nullPrintStream() throws NullPointerException {
  585.     if (currentTimeMillis() > 0)
  586.         return null;
  587.     throw new NullPointerException();
  588.     }
  589.  
  590.     /**
  591.      * Initialize the system class.  Called after thread initialization.
  592.      */
  593.     private static void initializeSystemClass() {
  594.     props = new Properties();
  595.     initProperties(props);
  596.     FileInputStream fdIn = new FileInputStream(FileDescriptor.in);
  597.     FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out);
  598.     FileOutputStream fdErr = new FileOutputStream(FileDescriptor.err);
  599.     setIn0(new BufferedInputStream(fdIn));
  600.     setOut0(new PrintStream(new BufferedOutputStream(fdOut, 128), true));
  601.     setErr0(new PrintStream(new BufferedOutputStream(fdErr, 128), true));
  602.     }
  603.  
  604. }
  605.