403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
|
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
|
-
-
+
+
+
+
-
-
+
+
-
+
+
+
|
[self close];
[_entry release];
[super dealloc];
}
- (void)lowlevelWriteBuffer: (const void *)buffer
length: (size_t)length
- (size_t)lowlevelWriteBuffer: (const void *)buffer
length: (size_t)length
{
size_t bytesWritten;
if (_stream == nil)
@throw [OFNotOpenException exceptionWithObject: self];
if ((uint64_t)length > _toWrite)
@throw [OFOutOfRangeException exception];
@try {
[_stream writeBuffer: buffer
length: length];
bytesWritten = [_stream writeBuffer: buffer
length: length];
} @catch (OFWriteFailedException *e) {
_toWrite -= [e bytesWritten];
@throw e;
}
_toWrite -= length;
_toWrite -= bytesWritten;
return bytesWritten;
}
- (bool)lowlevelIsAtEndOfStream
{
if (_stream == nil)
@throw [OFNotOpenException exceptionWithObject: self];
|