home *** CD-ROM | disk | FTP | other *** search
- package java.lang;
-
- import java.io.BufferedInputStream;
- import java.io.BufferedOutputStream;
- import java.io.FileDescriptor;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.InputStream;
- import java.io.PrintStream;
- import java.util.Properties;
-
- public final class System {
- // $FF: renamed from: in java.io.InputStream
- public static final InputStream field_0;
- public static final PrintStream out;
- public static final PrintStream err;
- private static SecurityManager security;
- private static Properties props;
-
- private System() {
- }
-
- private static InputStream InputStreamInitializer(FileDescriptor fd) {
- try {
- return new BufferedInputStream(new FileInputStream(fd), 128);
- } catch (Exception e) {
- throw new Error("can't initialize System input stream: " + e);
- }
- }
-
- private static PrintStream OutputStreamInitializer(FileDescriptor fd) {
- try {
- return new PrintStream(new BufferedOutputStream(new FileOutputStream(fd), 128), true);
- } catch (Exception e) {
- throw new Error("can't initialize System output stream " + fd + ": " + e);
- }
- }
-
- private static native void setSystemIO(InputStream var0, PrintStream var1, PrintStream var2);
-
- public static void setSecurityManager(SecurityManager s) {
- if (security != null) {
- throw new SecurityException("SecurityManager already set");
- } else {
- security = s;
- SecurityManager.setSecurityManager();
- }
- }
-
- public static SecurityManager getSecurityManager() {
- return security;
- }
-
- public static native long currentTimeMillis();
-
- public static native void arraycopy(Object var0, int var1, Object var2, int var3, int var4);
-
- private static native Properties initProperties(Properties var0);
-
- public static Properties getProperties() {
- if (props == null) {
- props = initProperties(new Properties());
- }
-
- SecurityManager.checksPropertiesAccess(1);
- return props;
- }
-
- public static void setProperties(Properties props) {
- SecurityManager.checksPropertiesAccess(1);
- System.props = props;
- }
-
- public static String getProperty(String key) {
- SecurityManager.checksPropertyAccess(key, 1);
- if (props == null) {
- props = initProperties(new Properties());
- }
-
- return props.getProperty(key);
- }
-
- public static String getProperty(String key, String def) {
- SecurityManager.checksPropertyAccess(key, 1);
- if (props == null) {
- props = initProperties(new Properties());
- }
-
- return props.getProperty(key, def);
- }
-
- public static String getenv(String name) {
- throw new Error("getenv no longer supported, use properties and -D instead: " + name);
- }
-
- public static void exit(int status) {
- Runtime.getRuntime().exit(status);
- }
-
- // $FF: renamed from: gc () void
- public static void method_0() {
- Runtime.getRuntime().gc();
- }
-
- public static void runFinalization() {
- Runtime.getRuntime().runFinalization();
- }
-
- public static void load(String filename) {
- SecurityManager.checksLink(filename, 1);
- Runtime.getRuntime().load(filename);
- }
-
- public static void loadLibrary(String libname) {
- SecurityManager.checksLink(libname, 1);
- Runtime.getRuntime().loadLibrary(libname);
- }
-
- static {
- field_0 = InputStreamInitializer(FileDescriptor.in);
- out = OutputStreamInitializer(FileDescriptor.out);
- err = OutputStreamInitializer(FileDescriptor.err);
- }
- }
-