I'll second Ron's approach.
As an FYI, once you have an OutputStream to the file, you can wrap it with a PrintStream and use the typical print methods on the file.
Quote:
PrintStream out;
DataOutputStream theFile;
FileConnection fc;
try {
fc = (FileConnection)Connector.open("file:///output.txt", Connector.WRITE);
fc.create();
theFile = fc.openDataOutputStream();
out = new PrintStream(theFile);
} catch (Exception e) {
...
}
|