Removing use of unsupported method enumerateByteRangesUsingBlock:
This commit is contained in:
parent
f891264228
commit
b43017257d
1 changed files with 9 additions and 6 deletions
|
|
@ -70,15 +70,18 @@
|
||||||
_inputStream = nil;
|
_inputStream = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)writeBytesIfPossible {
|
- (void) writeBytesIfPossible {
|
||||||
[self.data enumerateByteRangesUsingBlock:^(const void *bytes, NSRange byteRange, BOOL *stop) {
|
while ([self.outputStream hasSpaceAvailable] && self.bytesWritten < [self.data length]) {
|
||||||
|
const uint8_t *bytes = [self.data bytes];
|
||||||
NSInteger bytesWritten = [self.outputStream write:bytes maxLength:[self.data length] - self.bytesWritten];
|
NSInteger bytesWritten = [self.outputStream write:bytes maxLength:[self.data length] - self.bytesWritten];
|
||||||
|
|
||||||
if (bytesWritten < 0) {
|
if (bytesWritten < 0) {
|
||||||
*stop = YES;
|
[self cleanup];
|
||||||
} else {
|
return;
|
||||||
_bytesWritten += bytesWritten;
|
|
||||||
}
|
}
|
||||||
}];
|
|
||||||
|
_bytesWritten += bytesWritten;
|
||||||
|
}
|
||||||
|
|
||||||
if (self.bytesWritten >= [self.data length]) {
|
if (self.bytesWritten >= [self.data length]) {
|
||||||
[self cleanup];
|
[self cleanup];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue