package java.lang;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.StringTokenizer;
public class Runtime
{
public Process exec (String prog) throws IOException
{
return exec (prog, null);
}
public Process exec (String prog, String[] envp) throws IOException
{
StringTokenizer st = new StringTokenizer(prog);
String[] a = new String[st.countTokens ()];
for (int i = 0; i < a.length; i++)
a[i] = st.nextToken ();
return exec (a, envp);
}
public Process exec (String[] progarray) throws IOException
{
return exec (progarray, null);
}
public Process exec (String[] progarray, String[] envp) throws IOException
{
SecurityManager s = System.getSecurityManager();
if (s != null)
s.checkExec(progarray[0]);
return new ConcreteProcess (progarray, envp);
}
private final static void checkExit (int status)
{
SecurityManager s = System.getSecurityManager();
if (s != null)
s.checkExit(status);
}
public native void exit (int status);
final native void _exit (int status);
public native long freeMemory ();
public native void gc ();
public InputStream getLocalizedInputStream (InputStream in)
{
return in;
}
public OutputStream getLocalizedOutputStream (OutputStream out)
{
return out;
}
public static Runtime getRuntime ()
{
return self;
}
private final void checkLink (String lib)
{
if (lib == null)
throw new NullPointerException ();
SecurityManager s = System.getSecurityManager();
if (s != null)
s.checkLink(lib);
}
private native void _load (String pathname, boolean do_search);
public void load (String pathname)
{
_load (pathname, false);
}
public void loadLibrary (String libname)
{
_load (libname, true);
}
native boolean loadLibraryInternal (String libname);
public native void runFinalization ();
public static void runFinalizersOnExit (boolean run)
{
checkExit (0);
self.finalize_on_exit = run;
}
public native long totalMemory ();
public native void traceInstructions (boolean on);
public native void traceMethodCalls (boolean on);
private final native void init ();
private Runtime ()
{
init ();
}
private static Runtime self = new Runtime ();
private boolean finalize_on_exit;
}