This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes How to write data to file Java ME cldc 1.1 midp 2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "How to write data to file Java ME cldc 1.1 midp 2.0" Watch "How to write data to file Java ME cldc 1.1 midp 2.0" New topic
Author

How to write data to file Java ME cldc 1.1 midp 2.0

Kamil Kh
Greenhorn

Joined: Nov 10, 2011
Posts: 1
I newly in java me, please help me.

I make project in NetBeans 7.0.1. and use cldc 1.1 midp 2.0.

I want to write data to the file.

How can I do it?

I try to use FileOutputStream. But it don't exists in java.io

NetBeans shows me only this list of classes and interfaces in java.io:
ByteArrayInputStream, ByteArrayOutputStream, DataInput, DataInputStream, DataOutput, DataOutputStream, InputStream, InputStreamReader, OutputStream, OutputStreamWriter, PrintStream, Reader, Writer.

Why it so short?

And how I can write data to file?

Data can be array of bytes (byte[]) or Object it better.
Mahendr Shinde
Ranch Hand

Joined: Sep 03, 2011
Posts: 38

J2ME is very compact. it doesn't have any of FileReader, FileInputStream etc.
To access files, use GCF (Generic Connection Framework)
example:




NOTE: this will work only if your device supports FileConnections API (which is optional API)

There is still lot to learn!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to write data to file Java ME cldc 1.1 midp 2.0
 
Similar Threads
Strange objective: 1.2 MIME
BlackBerry main(1#) development language is Java
CLDC or MIDP?
Objectives for the SCMAD exam are here!!
Not support the float-point methods in io package of MIDP 2.0