home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VPage / Java.bin / CLASSES.ZIP / java / lang / System.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-07-08  |  3.8 KB  |  160 lines

  1. package java.lang;
  2.  
  3. import java.io.BufferedInputStream;
  4. import java.io.BufferedOutputStream;
  5. import java.io.FileDescriptor;
  6. import java.io.FileInputStream;
  7. import java.io.FileOutputStream;
  8. import java.io.InputStream;
  9. import java.io.PrintStream;
  10. import java.util.Properties;
  11.  
  12. public final class System {
  13.    // $FF: renamed from: in java.io.InputStream
  14.    public static final InputStream field_0 = nullInputStream();
  15.    public static final PrintStream out = nullPrintStream();
  16.    public static final PrintStream err = nullPrintStream();
  17.    private static SecurityManager security = null;
  18.    private static Properties props;
  19.  
  20.    private System() {
  21.    }
  22.  
  23.    public static void setIn(InputStream var0) {
  24.       checkIO();
  25.       setIn0(var0);
  26.    }
  27.  
  28.    public static void setOut(PrintStream var0) {
  29.       checkIO();
  30.       setOut0(var0);
  31.    }
  32.  
  33.    public static void setErr(PrintStream var0) {
  34.       checkIO();
  35.       setErr0(var0);
  36.    }
  37.  
  38.    private static void checkIO() {
  39.       if (security != null) {
  40.          security.checkExec("setio");
  41.       }
  42.  
  43.    }
  44.  
  45.    private static native void setIn0(InputStream var0);
  46.  
  47.    private static native void setOut0(PrintStream var0);
  48.  
  49.    private static native void setErr0(PrintStream var0);
  50.  
  51.    public static void setSecurityManager(SecurityManager var0) {
  52.       if (security != null) {
  53.          throw new SecurityException("SecurityManager already set");
  54.       } else {
  55.          security = var0;
  56.       }
  57.    }
  58.  
  59.    public static SecurityManager getSecurityManager() {
  60.       return security;
  61.    }
  62.  
  63.    public static native long currentTimeMillis();
  64.  
  65.    public static native void arraycopy(Object var0, int var1, Object var2, int var3, int var4);
  66.  
  67.    public static native int identityHashCode(Object var0);
  68.  
  69.    private static native Properties initProperties(Properties var0);
  70.  
  71.    public static Properties getProperties() {
  72.       if (security != null) {
  73.          security.checkPropertiesAccess();
  74.       }
  75.  
  76.       return props;
  77.    }
  78.  
  79.    public static void setProperties(Properties var0) {
  80.       if (security != null) {
  81.          security.checkPropertiesAccess();
  82.       }
  83.  
  84.       props = var0;
  85.    }
  86.  
  87.    public static String getProperty(String var0) {
  88.       if (security != null) {
  89.          security.checkPropertyAccess(var0);
  90.       }
  91.  
  92.       return props.getProperty(var0);
  93.    }
  94.  
  95.    public static String getProperty(String var0, String var1) {
  96.       if (security != null) {
  97.          security.checkPropertyAccess(var0);
  98.       }
  99.  
  100.       return props.getProperty(var0, var1);
  101.    }
  102.  
  103.    public static String getenv(String var0) {
  104.       throw new Error("getenv no longer supported, use properties and -D instead: " + var0);
  105.    }
  106.  
  107.    public static void exit(int var0) {
  108.       Runtime.getRuntime().exit(var0);
  109.    }
  110.  
  111.    // $FF: renamed from: gc () void
  112.    public static void method_0() {
  113.       Runtime.getRuntime().gc();
  114.    }
  115.  
  116.    public static void runFinalization() {
  117.       Runtime.getRuntime().runFinalization();
  118.    }
  119.  
  120.    public static void runFinalizersOnExit(boolean var0) {
  121.       Runtime.getRuntime();
  122.       Runtime.runFinalizersOnExit(var0);
  123.    }
  124.  
  125.    public static void load(String var0) {
  126.       Runtime.getRuntime().load(var0);
  127.    }
  128.  
  129.    public static void loadLibrary(String var0) {
  130.       Runtime.getRuntime().loadLibrary(var0);
  131.    }
  132.  
  133.    private static InputStream nullInputStream() throws NullPointerException {
  134.       if (currentTimeMillis() > 0L) {
  135.          return null;
  136.       } else {
  137.          throw new NullPointerException();
  138.       }
  139.    }
  140.  
  141.    private static PrintStream nullPrintStream() throws NullPointerException {
  142.       if (currentTimeMillis() > 0L) {
  143.          return null;
  144.       } else {
  145.          throw new NullPointerException();
  146.       }
  147.    }
  148.  
  149.    private static void initializeSystemClass() {
  150.       props = new Properties();
  151.       initProperties(props);
  152.       FileInputStream var0 = new FileInputStream(FileDescriptor.in);
  153.       FileOutputStream var1 = new FileOutputStream(FileDescriptor.out);
  154.       FileOutputStream var2 = new FileOutputStream(FileDescriptor.err);
  155.       setIn0(new BufferedInputStream(var0));
  156.       setOut0(new PrintStream(new BufferedOutputStream(var1, 128), true));
  157.       setErr0(new PrintStream(new BufferedOutputStream(var2, 128), true));
  158.    }
  159. }
  160.