home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / rt.jar / java / lang / Win32Process.class (.txt) < prev   
Encoding:
Java Class File  |  1998-04-23  |  1.9 KB  |  78 lines

  1. package java.lang;
  2.  
  3. import java.io.BufferedInputStream;
  4. import java.io.BufferedOutputStream;
  5. import java.io.FileDescriptor;
  6. import java.io.FileInputStream;
  7. import java.io.FileOutputStream;
  8. import java.io.InputStream;
  9. import java.io.OutputStream;
  10.  
  11. class Win32Process extends Process {
  12.    private int handle;
  13.    private FileDescriptor stdin_fd;
  14.    private FileDescriptor stdout_fd;
  15.    private FileDescriptor stderr_fd;
  16.    private OutputStream stdin_stream;
  17.    private InputStream stdout_stream;
  18.    private InputStream stderr_stream;
  19.  
  20.    Win32Process(String[] var1, String[] var2) throws Exception {
  21.       if (var1.length < 1) {
  22.          throw new IllegalArgumentException();
  23.       } else {
  24.          StringBuffer var3 = new StringBuffer(var1[0]);
  25.  
  26.          for(int var4 = 1; var4 < var1.length; ++var4) {
  27.             var3.append(' ').append(var1[var4]);
  28.          }
  29.  
  30.          String var5 = var3.toString();
  31.          String var6 = null;
  32.          if (var2 != null) {
  33.             StringBuffer var7 = new StringBuffer();
  34.  
  35.             for(int var8 = 0; var8 < var2.length; ++var8) {
  36.                var7.append(var2[var8]).append('\u0000');
  37.             }
  38.  
  39.             var6 = var7.toString();
  40.          }
  41.  
  42.          this.stdin_fd = new FileDescriptor();
  43.          this.stdout_fd = new FileDescriptor();
  44.          this.stderr_fd = new FileDescriptor();
  45.          this.create(var5, var6);
  46.          this.stdin_stream = new BufferedOutputStream(new FileOutputStream(this.stdin_fd));
  47.          this.stdout_stream = new BufferedInputStream(new FileInputStream(this.stdout_fd));
  48.          this.stderr_stream = new FileInputStream(this.stderr_fd);
  49.       }
  50.    }
  51.  
  52.    public OutputStream getOutputStream() {
  53.       return this.stdin_stream;
  54.    }
  55.  
  56.    public InputStream getInputStream() {
  57.       return this.stdout_stream;
  58.    }
  59.  
  60.    public InputStream getErrorStream() {
  61.       return this.stderr_stream;
  62.    }
  63.  
  64.    public void finalize() {
  65.       this.close();
  66.    }
  67.  
  68.    public native int exitValue();
  69.  
  70.    public native int waitFor();
  71.  
  72.    public native void destroy();
  73.  
  74.    private native void create(String var1, String var2);
  75.  
  76.    private native void close();
  77. }
  78.