BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 02-12-2010, 04:49 PM   #1 (permalink)
New Member
 
Join Date: Feb 2010
Model: 8300
PIN: N/A
Carrier: Telus
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Smile FileConnection fails after several iterations.

Please Login to Remove!

I wrote a program that periodically(every minute) receives updated data from server. Once the data is received it overwrites to the corresponding line of the file. ( code below )
Code below runs fine for first few iterations but throws IOException after.

Thanks.

try{
byte[] contents = bout.toByteArray(); // it always has fresh data.
conn = (FileConnection)Connector.open("file:///SDCard/update.txt");
if(!conn.exists())
conn.create();
out = conn.openOutputStream(index*rowSize);
out.write(contents);
}
finally{
if(conn!=null)
conn.close();
if(out!=null)
out.close();
}
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

SQUARE D 600V CONTACTOR 8502 SC03 S A 120V COIL (S9-2-82F)
$24.99
SQUARE D 600V CONTACTOR 8502 SC03 S A 120V COIL  (S9-2-82F) picture112801410002 Air Conditioner Condenser Coil - CRC112801410002 - NEW -
$139.0
112801410002 Air Conditioner Condenser Coil - CRC112801410002 - NEW -  pictureCOIL REPLACEMENT KIT - ICP 1171746 Superceded by 1177789 - NEW
$299.0
COIL REPLACEMENT KIT - ICP 1171746 Superceded by 1177789 - NEW  pictureRing Core Ferrite Bead Choke Coil Clamp RFI Cable Clip 20-Pack Snap On 3.5-13 mm
$11.92
Ring Core Ferrite Bead Choke Coil Clamp RFI Cable Clip 20-Pack Snap On 3.5-13 mm pictureC25ENF440a Cutler Hammer Contactor 4 Pole 40 Amp 120 Vac Coil
$29.99
C25ENF440a Cutler Hammer Contactor 4 Pole 40 Amp 120 Vac Coil picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.