Skip to main content

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

1 reply [Last post]
kamilbek
Offline
Joined: 2010-03-14
Points: 0

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.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mohsenof
Offline
Joined: 2011-09-26
Points: 0

I guess you need to learn more about J2ME before starting development. Find a book about J2ME or some online tutorials and follow it first. Maybe this can help: http://www.oracle.com/technetwork/java/javame/javamobile/training/jmesdk...

But briefly about your question: java 2 micro edition as its name says is much smaller than j2se in many aspects. Many of statndard edition's classes don't exist in micro edition or have more restricted funcrionality.

For writing to a file I found this: http://www.egjug.org/how_to_create_file_using_j2me

It was just a simple search!