Hello, I wrote simple program that reading *.jpg file into byte array.
But when i trying to open 400 kB jpg file it takes about 2 minutes.
I am using NOKIA 6233. Is it normal time for opening such size files?
But when you browsing jpg photos by internal tools it takes time not more than 2 second.
How can i reduce opening time, is there any othere means in J2ME?
Will be this time smaller if i will using C++ progrmming?
My code:
String s1;
s1 = System.getProperty("fileconn.dir.memorycard")+"proba.jpg";
FileConnection fc = (FileConnection)Connector.open(s1,Connector.READ);
DataInputStream txtinStream = fc.openDataInputStream();
ByteArrayOutputStream bStrm = new ByteArrayOutputStream();
int ch;
while ((ch = txtinStream.read()) != -1) bStrm.write(ch);
DataArray = bStrm.toByteArray();
stringItem2.setText(s1 + " "+java.lang.String.valueOf(DataArray.length));
fc.close();

Reply With Quote


