Class: NSOutputStream
Overview
The NSOutputStream class is a subclass of NSStream that provides write-only stream functionality.
Class Method Summary (collapse)
-
+ outputStreamToBuffer:capacity:
Creates and returns an initialized output stream that can write to a provided buffer.
-
+ outputStreamToFileAtPath:append:
Creates and returns an initialized output stream for writing to a specified file.
-
+ outputStreamToMemory
Creates and returns an initialized output stream that will write stream data to memory.
-
+ outputStreamWithURL:append:
Creates and returns an initialized output stream for writing to a specified URL.
Instance Method Summary (collapse)
-
- hasSpaceAvailable
Returns whether the receiver can be written to.
-
- initToBuffer:capacity:
Returns an initialized output stream that can write to a provided buffer.
-
- initToFileAtPath:append:
Returns an initialized output stream for writing to a specified file.
-
- initToMemory
Returns an initialized output stream that will write to memory.
-
- initWithURL:append:
Returns an initialized output stream for writing to a specified URL.
-
- write:maxLength:
Writes the contents of a provided data buffer to the receiver.
Methods inherited from NSStream
#close, #delegate, #open, #propertyForKey:, #removeFromRunLoop:forMode:, #scheduleInRunLoop:forMode:, #setDelegate:, #setProperty:forKey:, #streamError, #streamStatus
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Class Method Details
+ (Object) outputStreamToBuffer(buffer, capacity:capacity)
Creates and returns an initialized output stream that can write to a provided buffer. The stream must be opened before it can be used.When the number of bytes written to buffer has reached capacity, the stream’s streamStatus will return NSStreamStatusAtEnd.
+ (Object) outputStreamToFileAtPath(path, append:shouldAppend)
Creates and returns an initialized output stream for writing to a specified file. The stream must be opened before it can be used.
+ (Object) outputStreamToMemory
Creates and returns an initialized output stream that will write stream data to memory. The stream must be opened before it can be used.You retrieve the contents of the memory stream by sending the message propertyForKey: to the receiver with an argument of NSStreamDataWrittenToMemoryStreamKey.
+ (Object) outputStreamWithURL(url, append:shouldAppend)
Creates and returns an initialized output stream for writing to a specified URL. The stream must be opened before it can be used.
Instance Method Details
- (Boolean) hasSpaceAvailable
Returns whether the receiver can be written to.
- (Object) initToBuffer(buffer, capacity:capacity)
Returns an initialized output stream that can write to a provided buffer. The stream must be opened before it can be used.When the number of bytes written to buffer has reached capacity, the stream’s streamStatus will return NSStreamStatusAtEnd.
- (Object) initToFileAtPath(path, append:shouldAppend)
Returns an initialized output stream for writing to a specified file. The stream must be opened before it can be used.
- (Object) initToMemory
Returns an initialized output stream that will write to memory. The stream must be opened before it can be used.The contents of the memory stream are retrieved by passing the constant NSStreamDataWrittenToMemoryStreamKey to propertyForKey:.
- (Object) initWithURL(url, append:shouldAppend)
Returns an initialized output stream for writing to a specified URL. The stream must be opened before it can be used.
- (Integer) write(buffer, maxLength:length)
Writes the contents of a provided data buffer to the receiver.