NSInputStream
is an Objective-C objective-c class on iOS ios,
a subclass of NSStream
nsstream that provides read-only stream functionality. NSInputStream
is “toll-free bridged” with its Core Foundation counterpart, CFReadStreamRef
.
Questions tagged [nsinputstream]
150 questions
2
votes
3 answers
NSStreamEventEndEncountered not happen for NSInputStream when read content from file
I created a NSInputStream to load content from a file(IOS):
NSString* fileName = [[NSBundle mainBundle] pathForResource:@"resource" ofType:@".dat"];
NSInputStream* dataStream = [NSInputStream inputStreamWithFileAtPath:fileName];
if (dataStream ==…

crax
- 371
- 1
- 4
- 9
2
votes
1 answer
How to convert NSInputStream to NSString or how to read NSInputStream
I'm trying to convert my input stream to a string. The input stream I'm trying to convert is NSURLRequest.HTTPBodyStream, apparently the httpbody is set to null and replaced with the stream after you make the request. how do I go about doing this?…

Minimi
- 921
- 10
- 29
2
votes
1 answer
Methods to render a PDF into a very high resolution NSImage bitmap file
I have to render a PDF into a very high resolution image (say up to and even over 100,000 * 80,000 pixels).
I managed to do that without going out of ram by splitting the render into several slices and then rendering each one using NSOperationQueue,…

Fabio Cionini
- 767
- 6
- 15
2
votes
1 answer
Parse JSON String which contains an array with InputReader?
I have a problem with JSON. I searched through Internet, but didn't found any solution that worked for me.
For better working I saved the answer (JSON) of the server in a *.json file.
The JSON is looking like this (short…

TBockmair
- 83
- 6
2
votes
2 answers
NSOutputStream blocking, HasBytesAvailable event was not triggered
I am trying to create custom framework that will deal with ExternalAccessory.framework to do read/write operation with the connected accessory.
I can able to create a session and open the device to do read/write operations.
Problem i am facing was,…

iosLearner
- 1,312
- 1
- 16
- 30
2
votes
0 answers
Save audio data from NSInputStream into a file
I'm using multipeerconnectivity framework to transfer audio samples (CMSampleBufferRef) from the microphone. I can pass the samples using NSOutputStream for send data and NSInputStream for receive data.
Once I receive the data in the other device,…

Pablo Martinez
- 1,573
- 12
- 31
2
votes
3 answers
Convert an Objective-C method into Swift for NSInputStream (convert bytes into double)
I have the following code in Objective-C:
- (double)readDouble
{
double value = 0.0;
if ([self read:(uint8_t *)&value maxLength:8] != 8)
{
NSLog(@"***** Couldn't read double");
}
return value;
}
It works. But I don't…

Bagusflyer
- 12,675
- 21
- 96
- 179
2
votes
1 answer
Reading a NSInputStream produces a -1 bytes available error
I'm trying to do some simple encoding using NSInputStream and NSOutputStream:
import Foundation
let path = "/Users/johni/desktop/a" // holds "123456789abcdef"
var data: NSData = NSData(contentsOfFile: path)
var inp: NSInputStream =…

johni
- 5,342
- 6
- 42
- 70
2
votes
2 answers
NSInputStream with url coming up nil in iOS
I'm trying to set up a NSInputStream, but my input stream is comes out as nil when I step into the code. The url comes from a Dropbox account.
Getting the file through NSData after I have the url through Dropbox Chooser crashes my iPhone 4…

MScottWaller
- 3,321
- 2
- 24
- 47
2
votes
2 answers
Captcha on iPhone.
I have a website, require input username, pass and captcha to login.
Now, I develop an application on iPhone to login that website.
I don't know how to get that captcha and show on iphone.
I can get that Captcha in NSData and convert it into…

Brave
- 371
- 1
- 3
- 10
2
votes
1 answer
NSInputStream non-stop connection?
So I have both an input stream and an output stream and they are setup as the code provided below. The input stream's delegate method NSStreamEventHasBytesAvailable is called only when i write somedata onto the output stream. Why is that?
//…

Legolas
- 12,145
- 12
- 79
- 132
2
votes
0 answers
NSStreamDelegate not receiving messages
I have a TCP connection class which uses the NSStreamDelegate and works fine. It receives messages and respond to them in any matter. In some cases it should open a second connection. This is a second class which is quite similar to the first…

Julian F. Weinert
- 7,474
- 7
- 59
- 107
2
votes
1 answer
Does -[NSInputStream read:maxLength:] block?
I can't seem to find the answer to this anywhere, but does read:maxLength: on NSInputStream block until data is available or there is an error, or do I need to poll on hasBytesAvailable before attempting to read?

Patrick McDaniel
- 1,073
- 4
- 11
- 28
2
votes
2 answers
I cannot initialize a NSInputStream
Please help me, im going insane.
I need to create an NSInputStream so i can read a live preview from a camera over wifi.
liveViewStream is an NSInputStream-Instance-Variable that is declared in my implementation like so:
@implementation…

katzenhut
- 1,742
- 18
- 26
2
votes
1 answer
What Am I Missing? : iPhone Objective-C NSInputStream initWithData
I'm creating an NSInputStream from an NSData object but once created the stream reports NO for hasBytesAvailable:
NSData* data = [outputStream propertyForKey: NSStreamDataWrittenToMemoryStreamKey];
NSLog(@"creating stream with data 0x%x length…

gabe
- 29
- 1
- 2