Motorola E680 - Smartphone - GSM Developer's Manual page 68

Micro edition (j2me) applications
Hide thumbs Also See for E680 - Smartphone - GSM:
Table of Contents

Advertisement

}
if (fc.isDirectory()) {
}
else {
}
/*
* Create a FileConnection object pointing to file
*/
FileConnection fc = null;
try {
Connector.open("file://"+root+"testfile.txt");
} catch (IOException ioe) {
}
/*
* If file does not exists, create it
*/
if (! fc.exists() ) {
}
/*
*
Open stream for writing data
*/
DataOutputStream dataOutputStream;
try {
} catch (IOException ioe) {
}
/*
*
Open stream for reading data
*/
DataInputStream dataInputStream;
try {
} catch (IOException ioe) {
68
...
// first item is directory
//first item is file
fc = (FileConnection)
...
try {
fc.create();
} catch (SecurityException se) {
...
}
dataOutputStream = fc.openDataOutputStream();
//write data
dataOutputStream.close();
...
dataInputStream = fc.openDataInputStream();
// read data
dataInputStream.close();

Advertisement

Table of Contents
loading

Table of Contents