IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.Java.Externs.java.lang.System Class Reference

Implements the native methods for 'java.lang.System'. More...

Static Public Member Functions

static void registerNatives ()
 Implements the native method 'registerNatives'.
 
static void setIn0 (object @in)
 Implements the native method 'setIn0'.
 
static void setOut0 (object @out)
 Implements the native method 'setOut0'.
 
static void setErr0 (object err)
 Implements the native method 'setErr0'.
 
static long currentTimeMillis ()
 Implements the native method 'currentTimeMillis'.
 
static long nanoTime ()
 Implements the native method 'nanoTime'.
 
static void arraycopy (object src, int srcPos, object dest, int destPos, int length)
 Implements the native method 'arraycopy'.
 
static int identityHashCode (object x)
 Implements the native method 'identityHashCode'.
 
static string mapLibraryName (string libname)
 Implements the native method 'mapLibraryName'.
 

Detailed Description

Implements the native methods for 'java.lang.System'.

Definition at line 15 of file System.cs.

Member Function Documentation

◆ arraycopy()

static void IKVM.Java.Externs.java.lang.System.arraycopy ( object src,
int srcPos,
object dest,
int destPos,
int length )
static

Implements the native method 'arraycopy'.

This method exists as a performance optimization to prevent JNI.

Parameters
src
srcPos
dest
destPos
length

Definition at line 109 of file System.cs.

110 {
111 ByteCodeHelper.arraycopy(src, srcPos, dest, destPos, length);
112 }
static void arraycopy(object src, int srcStart, object dest, int destStart, int len)

◆ currentTimeMillis()

static long IKVM.Java.Externs.java.lang.System.currentTimeMillis ( )
static

Implements the native method 'currentTimeMillis'.

Returns

Definition at line 80 of file System.cs.

81 {
82 return DateTime.UtcNow.Ticks / 10000L - january_1st_1970;
83 }

◆ identityHashCode()

static int IKVM.Java.Externs.java.lang.System.identityHashCode ( object x)
static

Implements the native method 'identityHashCode'.

This method exists as a performance optimization to prevent JNI.

Parameters
x
Returns

Definition at line 122 of file System.cs.

123 {
124 return RuntimeHelpers.GetHashCode(x);
125 }

◆ mapLibraryName()

static string IKVM.Java.Externs.java.lang.System.mapLibraryName ( string libname)
static

Implements the native method 'mapLibraryName'.

Parameters
libname
Returns

Definition at line 132 of file System.cs.

133 {
134#if FIRST_PASS
135 throw new NotImplementedException();
136#else
137 if (libname == null)
138 throw new global::java.lang.NullPointerException();
139
141 return libname + ".dll";
142 else if (RuntimeUtil.IsOSX)
143 return "lib" + libname + ".dylib";
144 else
145 return "lib" + libname + ".so";
146#endif
147 }
Maintains various information about the current runtime environment.
static bool IsOSX
Returns true if the current platform is Mac OS X.
static bool IsWindows
Returns true if the current platform is Windows.

◆ nanoTime()

static long IKVM.Java.Externs.java.lang.System.nanoTime ( )
static

Implements the native method 'nanoTime'.

Returns

Definition at line 89 of file System.cs.

90 {
91 const long NANOS_PER_SEC = 1000000000;
92
93 var time = (double)Stopwatch.GetTimestamp();
94 var freq = (double)Stopwatch.Frequency;
95 return (long)(time / freq * NANOS_PER_SEC);
96 }

◆ registerNatives()

static void IKVM.Java.Externs.java.lang.System.registerNatives ( )
static

Implements the native method 'registerNatives'.

Definition at line 34 of file System.cs.

35 {
36
37 }

◆ setErr0()

static void IKVM.Java.Externs.java.lang.System.setErr0 ( object err)
static

Implements the native method 'setErr0'.

Definition at line 67 of file System.cs.

68 {
69#if FIRST_PASS
70 throw new NotImplementedException();
71#else
72 SystemAccessor.SetErr(err);
73#endif
74 }

◆ setIn0()

static void IKVM.Java.Externs.java.lang.System.setIn0 ( object @ in)
static

Implements the native method 'setIn0'.

Parameters
in

Definition at line 43 of file System.cs.

44 {
45#if FIRST_PASS
46 throw new NotImplementedException();
47#else
48 SystemAccessor.SetIn(@in);
49#endif
50 }

◆ setOut0()

static void IKVM.Java.Externs.java.lang.System.setOut0 ( object @ out)
static

Implements the native method 'setOut0'.

Definition at line 55 of file System.cs.

56 {
57#if FIRST_PASS
58 throw new NotImplementedException();
59#else
60 SystemAccessor.SetOut(@out);
61#endif
62 }

The documentation for this class was generated from the following file: