Methods Summary |
---|
public SerializableResource | deserializeResource(SerializableResource sr, int resourceID)Reads resource from the stream.
moveStreamTo(resourceID);
sr.read(istream);
return sr;
|
protected void | freeResourceBundle()Closes resource bundle.
if (storage == null) {
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_JSR238,
"Trying to close null storage");
}
return;
}
try {
istream.close();
} catch (IOException e) {
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_JSR238,
"Exception while closing input stream: " + e.toString());
}
}
try {
storage.disconnect();
} catch (IOException e) {
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_JSR238,
"Exception while disconnecting from storage: " + e.toString());
}
}
|
public static ResourceBundleReader | getInstance(java.lang.String name)Creates initialized instance of ResourceBundleReader , opens
resource bundle and reads up header.
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION, LogChannels.LC_JSR238,
"DevResourceBundleReader: Get device resource " +
"bundle reader for \"" + name + "\"");
}
DevResourceBundleReader devreader = new DevResourceBundleReader();
if (!devreader.initialize(name)) {
return null;
}
// bundle wasn't found
return devreader;
|
protected java.io.InputStream | getResourceBundleAsStream()Opens resource bundle and return its stream.
Bundle is opened from storage root.
try {
if (storage == null) {
storage = new RandomAccessStream(classSecurityToken);
}
if (storage == null) {
throw new IOException("Cannot access storage.");
}
storage.connect(File.getConfigRoot(Constants.INTERNAL_STORAGE_ID) + Configuration
.getProperty("microedition.global.root")
+ resourceName, Connector.READ);
return storage.openInputStream();
} catch (IOException ioe) {
if (Logging.TRACE_ENABLED) {
Logging.trace(ioe, "");
}
return null;
}
|