2006-08-13 17:12:35 +02:00
|
|
|
importPackage(java.io);
|
|
|
|
|
|
|
|
function writeFile( file, stream ) {
|
|
|
|
var buffer = new PrintWriter( new FileWriter( file ) );
|
|
|
|
buffer.print( stream );
|
|
|
|
buffer.close();
|
|
|
|
}
|
2006-10-08 11:57:17 +02:00
|
|
|
|
|
|
|
function read( file ) {
|
|
|
|
var jq = new File(file);
|
|
|
|
var reader = new BufferedReader(new FileReader(jq));
|
|
|
|
var line = null;
|
|
|
|
var buffer = new java.lang.StringBuffer(jq.length());
|
|
|
|
while( (line = reader.readLine()) != null) {
|
|
|
|
buffer.append(line);
|
|
|
|
buffer.append("\n");
|
|
|
|
}
|
|
|
|
return buffer.toString();
|
|
|
|
}
|