MCPcopy Create free account
hub / github.com/ReadyTalk/avian / System

Class System

classpath/java/lang/System.java:24–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22import java.util.Properties;
23
24public abstract class System {
25 private static final long NanoTimeBaseInMillis = currentTimeMillis();
26
27 private static class Static {
28 public static Properties properties = makeProperties();
29 }
30
31 private static Map<String, String> environment;
32
33 private static SecurityManager securityManager;
34 // static {
35 // loadLibrary("natives");
36 // }
37
38 public static final PrintStream out = new PrintStream
39 (new BufferedOutputStream(new FileOutputStream(FileDescriptor.out)), true);
40
41 public static final PrintStream err = new PrintStream
42 (new BufferedOutputStream(new FileOutputStream(FileDescriptor.err)), true);
43
44 public static final InputStream in
45 = new BufferedInputStream(new FileInputStream(FileDescriptor.in));
46
47 public static native void arraycopy(Object src, int srcOffset, Object dst,
48 int dstOffset, int length);
49
50 public static String getProperty(String name) {
51 return (String) Static.properties.get(name);
52 }
53
54 public static String getProperty(String name, String defaultValue) {
55 String result = getProperty(name);
56 if (result==null) {
57 return defaultValue;
58 }
59 return result;
60 }
61
62 public static String setProperty(String name, String value) {
63 return (String) Static.properties.put(name, value);
64 }
65
66 public static Properties getProperties() {
67 return Static.properties;
68 }
69
70 private static Properties makeProperties() {
71 Properties properties = new Properties();
72
73 for (String p: getNativeProperties()) {
74 if (p == null) break;
75 int index = p.indexOf('=');
76 properties.put(p.substring(0, index), p.substring(index + 1));
77 }
78
79 for (String p: getVMProperties()) {
80 if (p == null) break;
81 int index = p.indexOf('=');

Callers

nothing calls this directly

Calls 1

currentTimeMillisMethod · 0.95

Tested by

no test coverage detected