@@ -221,28 +221,20 @@ fd = fd_; return self; } -- (void)dealloc -{ - if (closable && fd != -1) - close(fd); - - [super dealloc]; -} - -- (BOOL)atEndOfStreamWithoutCache +- (BOOL)_atEndOfStream { if (fd == -1) return YES; return eos; } -- (size_t)readNBytesWithoutCache: (size_t)size - intoBuffer: (char*)buf +- (size_t)_readNBytes: (size_t)size + intoBuffer: (char*)buf { size_t ret; if (fd == -1 || eos) @throw [OFReadFailedException newWithClass: isa @@ -251,12 +243,12 @@ eos = YES; return ret; } -- (size_t)writeNBytesWithoutCache: (size_t)size - fromBuffer: (const char*)buf +- (size_t)_writeNBytes: (size_t)size + fromBuffer: (const char*)buf { size_t ret; if (fd == -1 || eos || (ret = write(fd, buf, size)) < size) @throw [OFWriteFailedException newWithClass: isa @@ -271,10 +263,18 @@ close(fd); fd = -1; return self; } + +- (void)dealloc +{ + if (closable && fd != -1) + close(fd); + + [super dealloc]; +} @end /// \cond internal @implementation OFFileSingleton - initWithPath: (OFString*)path