//------------------------------------------------------ // * TraceStream //------------------------------------------------------ // Constructor used by -applets- passing in document base // URL's and file names. // public TraceStream(URL DocumentBase,String traceName,String expName) throws IOException { // Create a URL to open the file since Netscape and other browsers do // not allow reading and writing files on local file system. I think this // implies that subsequent stream I/O goes through the web server where the // URL resides (taking a performance hit as it does). I believe it also means // that everything accessed must be in a subdirectory (references work) of // codeBase. In the future I will probably implement a simple file server // that the viewer can connect to in order to get around this problem. URL traceURL = new URL(DocumentBase, traceName); URL expURL = new URL(DocumentBase, expName); // Create a buffered input stream from a stream opened from the URL // Buffering input greatly improves performance. BufferedInputStream traceIn = new BufferedInputStream(traceURL.openStream()); BufferedInputStream expIn = new BufferedInputStream(expURL.openStream()); theTrace = new SCFTrace(traceIn); EXPQuality theQuality = new EXPQuality(expIn); theTrace.CopyQuality(theQuality.Quality,theQuality.NumBases); } //------------------------------------------------------ // * TraceStream //------------------------------------------------------ // Constructor used by -applications- passing in directory // and file names. // public TraceStream(String traceDir,String traceName,String expDir,String expName) throws IOException { String tracePath = traceDir+traceName; String expPath = expDir+expName; File expFile = new File(expPath); File traceFile = new File(tracePath); FileInputStream expFileIn = new FileInputStream(expFile); FileInputStream traceFileIn = new FileInputStream(traceFile); // Create a buffered input stream from a stream opened from the URL // Buffering input greatly improves performance. BufferedInputStream traceIn = new BufferedInputStream(traceFileIn); BufferedInputStream expIn = new BufferedInputStream(expFileIn); // Determine what kind of file it is and create an object of that type // (reading in the data from the stream). theTrace = new SCFTrace(traceIn); EXPQuality theQuality = new EXPQuality(expIn); theTrace.CopyQuality(theQuality.Quality,theQuality.NumBases); }