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", |
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 |
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 |
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. |
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 |
/** |
/** |
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 |
/** |
/** |
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 |
/** |
/** |
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> ... |
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 |
*/ |
*/ |
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 |