iOS Development Series-nsoutputstream

Source: Internet
Author: User
Nsoutputstream Creating an Nsoutputstream instance
- (nullable instancetype)initToFileAtPath:(NSString *)path append:(BOOL)shouldAppend;

Parameter one set the target file path. The second parameter, Shouldappend, if passed as yes, means that each time a stream is written to the file, it is stitched at the end of the content.

Open Nsoutputstream The stream needs to be opened before writing the file.
- (void)open;

如果初始化传入的目标文件路径的文件不存在会主动创建

Writing files to the target file
- (NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)len;

The first parameter passes in a binary byte array, such as NSData's bytes. The byte length of the second write data.

Close the stream
- (void)close;

iOS Development Series-nsoutputstream

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.