BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 12-20-2005, 01:35 PM   #1
mouli
Knows Where the Search Button Is
 
Join Date: Dec 2005
Model: 8300
Carrier: T-Mobile
Posts: 15
Default Blackberry File API problem

Please Login to Remove!

I am trying to read a file (currently using only simulator) using Blackberry File API. I created a FileInputStream object and LineReader object to read line by line. I am not able to read more than (approx)120 bytes. This is the code I am using to test .

Any help?

Thanks

Mouli.
--------------------
Code:
FileInputStream fis = new FileInputStream(fs,filename);
LineReader lr = new LineReader(fis);
byte[] b;
try {
	b = lr.readLine();
	String s;
	while(b.length > 0) {
		s = new String(b);
		System.out.println("line read : " + s);
		b = lr.readLine();
	}
}
catch(EOFException eof) {
	//eof file reached.
	eof.printStackTrace();
	System.out.println("eofexception " + eof.getMessage());
}
---------------

Last edited by Mark Rejhon; 12-21-2005 at 03:08 AM.. Reason: Added [code] tags
Offline  
Old 09-04-2006, 06:57 AM   #2
csivaraj
Knows Where the Search Button Is
 
csivaraj's Avatar
 
Join Date: Sep 2006
Model: 7290
Posts: 15
Smile

Quote:
Originally Posted by mouli
I am trying to read a file (currently using only simulator) using Blackberry File API. I created a FileInputStream object and LineReader object to read line by line. I am not able to read more than (approx)120 bytes. This is the code I am using to test .

Any help?

Thanks

Mouli.
--------------------
Code:
FileInputStream fis = new FileInputStream(fs,filename);
LineReader lr = new LineReader(fis);
byte[] b;
try {
	b = lr.readLine();
	String s;
	while(b.length > 0) {
		s = new String(b);
		System.out.println("line read : " + s);
		b = lr.readLine();
	}
}
catch(EOFException eof) {
	//eof file reached.
	eof.printStackTrace();
	System.out.println("eofexception " + eof.getMessage());
}
---------------



Hai mouli,

How can i program to access file in BlackBerry(using JDE)?

Is there any restriction or any rule to follow? I have problem for that. i tried to access files but i cant. Can you tell me the way?


by
Sivaraj
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Multitech Systems V.34 FF440 FaxFinder Fax Server 4 Port picture

Multitech Systems V.34 FF440 FaxFinder Fax Server 4 Port

$449.94



Server SE-SS 07020 Server Express Single Drop-In - NEW - COMPLETE - Genuine OEM picture

Server SE-SS 07020 Server Express Single Drop-In - NEW - COMPLETE - Genuine OEM

$199.99



USED Moxa NPort5610-16 16-port RS-232 Serial Communication Server picture

USED Moxa NPort5610-16 16-port RS-232 Serial Communication Server

$284.58



NEW MOXA NPORT W2150A serial server DHL Fast delivery picture

NEW MOXA NPORT W2150A serial server DHL Fast delivery

$379.44



EMC2 HPE-S HPES Server picture

EMC2 HPE-S HPES Server

$465.00



âš¡Avtron SLS-10 Server Load Simulator Generator - 2 Channels - 10 kW - Tested âš¡ picture

âš¡Avtron SLS-10 Server Load Simulator Generator - 2 Channels - 10 kW - Tested âš¡

$789.00







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