Java Reference
In-Depth Information
Using Resource Files
Resource files are another form of persistent storage. Accessing resource files is very simple,
but they are important nevertheless. Resource files can be images, text, or other types of files
that are stored in a MIDlet suite JAR. These files are read-only.
You can access a resource file as an InputStream by using the getResourceAsStream()
method in Class . A typical usage looks like this:
InputStream in = this.getClass().getResourceAsStream("/Robotag-t.png");
Summary
The MIDP API for persistent storage is deliberately abstract in recognition that small devices will
likely have many different methods for storing data. In MIDP, the central concept for persistent
storage is the record store, which is a collection of bits of data called records. A record store is
really a tiny database, but the details of exactly how records are stored is specific to a device
implementation. The javax.microedition.rms.RecordStore class encapsulates all access to
persistent storage. It provides methods for accessing and manipulating RecordStore s, as well as
methods for working with individual records. For more advanced RecordStore work, methods and
interfaces exist to help keep track of changes to a RecordStore or to perform RecordStore queries.
Search WWH ::




Custom Search