Questions tagged [nsinputstream]

NSInputStream is an Objective-C class on iOS , a subclass of NSStream that provides read-only stream functionality. NSInputStream is “toll-free bridged” with its Core Foundation counterpart, CFReadStreamRef.

150 questions
0
votes
1 answer

Writes to NSOutputStream after performing work on background thread don't work

I have a program that is sending large files over NSStreams after some initial processing. The flow of the application goes like this: 1) Two devices connect to each other, open their input and output streams, and schedule their run loops: …
user3062913
  • 353
  • 2
  • 10
0
votes
1 answer

Subclassing NSInputStream, overriding delegate?

I've made an NSInputStream subclass, but when it gets to read the actual data I get the following exception. *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -setDelegate: only defined for abstract class. …
Zsolt Molnár
  • 305
  • 2
  • 8
0
votes
1 answer

Bonjour/NSNetService Data written to NSOutputStream never makes it to the other side (includesPeerToPeer = true)

I have an iOS app that establish a peer-to-peer connection through Bonjour/NSNetService. (based on the WiTap sample code) In some cases, both devices won’t receive data anymore after a few seconds while they are still able to write data out (i.e.…
0
votes
2 answers

NSDictionary into a NSInputStream

Is it possible to put in my NSDictionary into a NSInputStream? This would be my NSDictionary NSArray *keys = [NSArray arrayWithObjects:@"name", @"device_token", @"identifier", nil]; NSArray *values = [NSArray arrayWithObjects:@"Test iPhone",…
gabac
  • 2,062
  • 6
  • 21
  • 30
0
votes
0 answers

NSInputstream & EventEndOfStream

So this is my issue. A programs writes log files to a specific folder. Once a log file is created it is written to about every 2 seconds until it reaches approx 5MB. A new file is created then. I am Parsi g the log files to gather data real time. I…
Jeff Brown
  • 86
  • 8
0
votes
1 answer

How do I set an encoding type on NSInputStream?

I need to stream an image to a .NET backend service using Windows 1252 encoding. So I believe I need to create a NSURLRequest with its HTTPBodyStream set to a NSInputStream which is created with image data. And I need the encoding to be set to…
Steve Moser
  • 7,647
  • 5
  • 55
  • 94
0
votes
1 answer

Reading large files from NSInputstream is not working in ios

I am trying to read large Image file more than 300KB from NSInputStream. But i'm getting only upto 300KB. Other data are missing. Could you please help me if you know. i'm waiting for your valuable answer. I mentioned my code below : Call this…
vishnu
  • 13
  • 2
0
votes
1 answer

Swift nsinputstream not giving me the correct data from Trimble

I've developed this for the android and simply used a bufferedreader and br.readline() and the code properly interpreted the data coming through. I should be getting data that looks like…
Randall Meyer
  • 325
  • 2
  • 6
0
votes
3 answers

Curious, is it possible to get [UIImage] from NSMutableData

On my iOS side, i received a stream of images via NSInputStream. NSMutableData will be containing images in [JPG IMAGE][JPG IMAGE][PNG IMAGE]. Is there any elegant way of getting the images from NSMutableData? EDIT: Thanks for all the replies. I…
perwyl
  • 323
  • 3
  • 14
0
votes
1 answer

HTTP POST with multipart NSInputStream in Swift

I need to send a multipart/form-data HTTP POST request with a file and some extra data. The files might be kind of big, so I cannot read them with NSData because it will trigger a memory issue, so the file has to be read with NSInputStream. I've…
Olav Gausaker
  • 496
  • 3
  • 14
0
votes
1 answer

NSOutputStream's hasSpaceAvailable method always returns False

In my app, I need to use polling instead of run loop while performing certain operations over the network. My code looks like below -(id) init { self = [super init]; if (self) { CFReadStreamRef readStream; CFWriteStreamRef…
0
votes
2 answers

[(NSInputStream *)stream read:buf maxLength:1024]; returns very huge value

In code line ->NSInteger len = [(NSInputStream *)stream read:buf maxLength:1024]; I am getting very huge value of len from this method like:(18446744073709551615) and crashes Terminating app due to uncaught exception 'NSMallocException',…
user4388479
  • 19
  • 1
  • 6
0
votes
1 answer

Processing potentially large STDIN data, more than once

I'd like to provide an accessor on a class that provides an NSInputStream for STDIN, which may be several hundred megabytes (or gigabytes, though unlikely, perhaps) of data. When a caller gets this NSInputStream it should be able to read from it…
d11wtq
  • 34,788
  • 19
  • 120
  • 195
0
votes
3 answers

Read huge file from disk

I am developing an iOS app and I have this text file with a city name per line. I have like 3 Million cities in that file. In order to be able to perform searches and operations on it I am using a B-Tree but this tree takes a long time to be…
apinho
  • 2,235
  • 3
  • 25
  • 39
0
votes
1 answer

NSInputStream for Twitter Streaming API iOS?

Simple question: Can I use NSInputStream to get data from the streaming API? If so, can someone outline what this can look like. I have tried something like _twitterStream = [[NSInputStream alloc]initWithURL:[NSURL…
ChrisC
  • 892
  • 2
  • 12
  • 33