我使用此代码从服务器获取数据:
AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id responseObject){}
failure:^(AFHTTPRequestOperation *operation, NSError *error){}];
operation.outputStream = [NSOutputStream outputStreamToFileAtPath:
[DOCUMENTS_FOLDER stringByAppendingPathComponent:@"test.m4v"] append:YES];
问题是:服务器发送了512 KB数据,但写入的数据超过900 KB。我认为原因是:它将每个字节的十六进制表示写入文件NOT BINARY。
请帮忙:如何写BINARY数据?