Skip to content

Instantly share code, notes, and snippets.

@mingchen
Created August 21, 2012 07:49
Show Gist options
  • Save mingchen/3413229 to your computer and use it in GitHub Desktop.
Save mingchen/3413229 to your computer and use it in GitHub Desktop.
How to use NSOutputStream's outputStreamToMemoryDemo
- (void)outputStreamToMemoryDemo
{
NSOutputStream *output = [NSOutputStream outputStreamToMemory];
[output open];
//
//...
//
[output close];
NSData * data = [output propertyForKey:NSStreamDataWrittenToMemoryStreamKey];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment