/[classpath]/classpath/java/lang/System.java
ViewVC logotype

Diff of /classpath/java/lang/System.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by mark, Thu Oct 3 15:10:03 2002 UTC revision 1.26 by jewel, Wed Dec 18 14:09:45 2002 UTC
# Line 85  public final class System Line 85  public final class System
85                      Configuration.CLASSPATH_VERSION);                      Configuration.CLASSPATH_VERSION);
86    
87      defaultProperties.put("gnu.cpu.endian",      defaultProperties.put("gnu.cpu.endian",
88                            isWordsBigEndian() ? "big" : "little");                            VMSystem.isWordsBigEndian() ? "big" : "little");
89    
90      // Common encoding aliases. See gnu.java.io.EncodingManager.      // Common encoding aliases. See gnu.java.io.EncodingManager.
91        defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO8859_1",
92                              "8859_1");
93    
94      defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-1",      defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-1",
95                            "8859_1");                            "8859_1");
96      defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-2",      defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-2",
# Line 210  public final class System Line 213  public final class System
213     * other processes or files.  That should all be transparent to you,     * other processes or files.  That should all be transparent to you,
214     * however.     * however.
215     */     */
216    public static final InputStream in     public static final InputStream in  = VMSystem.makeStandardInputStream();
217      = new BufferedInputStream(new FileInputStream(FileDescriptor.in));  
218    /**    /**
219     * The standard output PrintStream.  This is assigned at startup and     * The standard output PrintStream.  This is assigned at startup and
220     * starts its life perfectly valid. Although it is marked final, you can     * starts its life perfectly valid. Although it is marked final, you can
# Line 222  public final class System Line 225  public final class System
225     * output to other processes or files.  That should all be transparent to     * output to other processes or files.  That should all be transparent to
226     * you, however.     * you, however.
227     */     */
228    public static final PrintStream out     public static final PrintStream out = VMSystem.makeStandardOutputStream();
229      = new PrintStream(new BufferedOutputStream  
       (new FileOutputStream(FileDescriptor.out)), true);  
230    /**    /**
231     * The standard output PrintStream.  This is assigned at startup and     * The standard output PrintStream.  This is assigned at startup and
232     * starts its life perfectly valid. Although it is marked final, you can     * starts its life perfectly valid. Although it is marked final, you can
# Line 235  public final class System Line 237  public final class System
237     * output to other processes or files.  That should all be transparent to     * output to other processes or files.  That should all be transparent to
238     * you, however.     * you, however.
239     */     */
240    public static final PrintStream err     public static final PrintStream err = VMSystem.makeStandardErrorStream();
     = new PrintStream(new BufferedOutputStream  
       (new FileOutputStream(FileDescriptor.err)), true);  
241    
242    /**    /**
243     * This class is uninstantiable.     * This class is uninstantiable.
# Line 260  public final class System Line 260  public final class System
260      SecurityManager sm = Runtime.securityManager; // Be thread-safe.      SecurityManager sm = Runtime.securityManager; // Be thread-safe.
261      if (sm != null)      if (sm != null)
262        sm.checkPermission(new RuntimePermission("setIO"));        sm.checkPermission(new RuntimePermission("setIO"));
263      setIn0(in);      VMSystem.setIn(in);
264    }    }
265    
266    /**    /**
# Line 277  public final class System Line 277  public final class System
277      SecurityManager sm = Runtime.securityManager; // Be thread-safe.      SecurityManager sm = Runtime.securityManager; // Be thread-safe.
278      if (sm != null)      if (sm != null)
279        sm.checkPermission(new RuntimePermission("setIO"));        sm.checkPermission(new RuntimePermission("setIO"));
280      setOut0(out);      
281        VMSystem.setOut(out);
282    }    }
283    
284    /**    /**
# Line 294  public final class System Line 295  public final class System
295      SecurityManager sm = Runtime.securityManager; // Be thread-safe.      SecurityManager sm = Runtime.securityManager; // Be thread-safe.
296      if (sm != null)      if (sm != null)
297        sm.checkPermission(new RuntimePermission("setIO"));        sm.checkPermission(new RuntimePermission("setIO"));
298      setErr0(err);      VMSystem.setErr(err);
299    }    }
300    
301    /**    /**
# Line 343  public final class System Line 344  public final class System
344     * @return the current time     * @return the current time
345     * @see java.util.Date     * @see java.util.Date
346     */     */
347    public static native long currentTimeMillis();    public static long currentTimeMillis() {
348          return VMSystem.currentTimeMillis();
349      }
350    
351    /**    /**
352     * Copy one array onto another from <code>src[srcStart]</code> ...     * Copy one array onto another from <code>src[srcStart]</code> ...
# Line 639  public final class System Line 642  public final class System
642    
643    /**    /**
644     * Convert a library name to its platform-specific variant.     * Convert a library name to its platform-specific variant.
645     *     *   * @param libname the library name, as used in <code>loadLibrary</code>
    * @param libname the library name, as used in <code>loadLibrary</code>  
646     * @return the platform-specific mangling of the name     * @return the platform-specific mangling of the name
647     * @since 1.2     * @since 1.2
648     */     */
# Line 650  public final class System Line 652  public final class System
652      return Runtime.nativeGetLibname("", libname);      return Runtime.nativeGetLibname("", libname);
653    }    }
654    
   /**  
    * Detect big-endian systems.  
    *  
    * @return true if the system is big-endian.  
    */  
   static native boolean isWordsBigEndian();  
   
   /**  
    * Set {@link #in} to a new InputStream.  
    *  
    * @param in the new InputStream  
    * @see #setIn(InputStream)  
    */  
   private static native void setIn0(InputStream in);  
   
   /**  
    * Set {@link #out} to a new PrintStream.  
    *  
    * @param out the new PrintStream  
    * @see #setOut(PrintStream)  
    */  
   private static native void setOut0(PrintStream out);  
   
   /**  
    * Set {@link #err} to a new PrintStream.  
    *  
    * @param err the new PrintStream  
    * @see #setErr(PrintStream)  
    */  
   private static native void setErr0(PrintStream err);  
655  } // class System  } // class System

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26