I have an NSData object. I am using the sample AJAXFileUpload
which gives me an NSData object. I am reading in a tab delimited
text file and was wondering how do I read line per line.
Thanks
James Cicenia
___
Do not post admin requests to the list.
Hi,
try something like this:
NSData data = ...; // your existing NSData object
try {
BufferedReader reader = new BufferedReader(new InputStreamReader
(data.stream()));
try {
while (reader.ready()) {
String line = reader.readLine();
Use a java.io.BufferReader.readLine()
On Jan 5, 2009, at 2:56 PM, James Cicenia wrote:
I have an NSData object. I am using the sample AJAXFileUpload
which gives me an NSData object. I am reading in a tab delimited
text file and was wondering how do I read line per line.
Thanks
James Cicenia
I'm lazy so I would usually do something like this:
NSData yourNSData = whateverYourDataIs();
String encoding = whatEverYourEncodingIs();
try {
String text = new String( yourNSData.bytes(), encoding );
NSArrayString lines =