![]() |
File Handling
How would I read/write from a file in Java? It seems that FRC has omitted the Scanner and the FileOutputStream classes, the only ways I know how to do file io.
Thanks in advance |
Re: File Handling
Look at the javadocs for the following classes:
com.sun.squawk.microedition.io.FileConnection javax.microedition.io.Connector java.io.DataOutputStream java.io.DataInputStream For example, to create an output file on the cRIO: DataOutputStream theFile; FileConnection fc; try { fc = (FileConnection)Connector.open("file:///output.txt", Connector.WRITE); fc.create(); theFile = fc.openDataOutputStream(); } catch (Exception e) { ... } You can then use the writeXXX() methods in DataOutputStream to write to the file. Be sure to flush() also. - Ron Team #2607 controls mentor |
| All times are GMT -5. The time now is 03:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi