Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Kamil Kh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 38
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic