Go to Post Continue? You mean we can quit? Why didn't someone say so! - tsaksa [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-02-2010, 21:07
Patrick Chiang Patrick Chiang is offline
Programming
FRC #3070 (Team Pronto)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Seattle
Posts: 162
Patrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to all
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
  #2   Spotlight this post!  
Unread 19-02-2010, 20:47
rrossbach rrossbach is offline
Registered User
AKA: Ron R
FRC #2607 (RoboVikings)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Warrington PA
Posts: 90
rrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to behold
Arrow 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
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
carmen ball handling falconmaster General Forum 14 30-01-2009 10:50
How to use the data obtain in one C file to another C file? tommy_chai Programming 8 11-01-2008 02:17
Didn't Like Digital Handling Anime-niac_2.9 Programming 1 05-02-2007 13:46
How do we convert a modified user routines file into a valid .HEX file HuskieRobotics Programming 13 28-02-2004 12:12
A New Method of Handling Nationals archiver 2001 9 24-06-2002 03:30


All times are GMT -5. The time now is 10:49.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi