@@ -66,10 +66,13 @@ - initWithPath: (const char*)path andMode: (const char*)mode { if ((self = [super init])) { if ((fp = fopen(path, mode)) == NULL) { + [[OFOpenFileFailedException newWithObject: self + andPath: path + andMode: mode] raise]; [self free]; return nil; } } return self; @@ -84,11 +87,11 @@ - (BOOL)atEndOfFile { return (feof(fp) == 0 ? NO : YES); } -- (size_t)readIntoBuffer: (char*)buf +- (size_t)readIntoBuffer: (uint8_t*)buf withSize: (size_t)size andNItems: (size_t)nitems { size_t ret; @@ -98,15 +101,15 @@ andNItems: nitems] raise]; return ret; } -- (char*)readWithSize: (size_t)size - andNItems: (size_t)nitems +- (uint8_t*)readWithSize: (size_t)size + andNItems: (size_t)nitems { uint64_t memsize; - char *ret; + uint8_t *ret; if (size >= 0xFFFFFFFF || nitems >= 0xFFFFFFFF || (memsize = (uint64_t)nitems * size) > 0xFFFFFFFF) { [[OFOverflowException newWithObject: self] raise]; return NULL; @@ -125,11 +128,11 @@ } return ret; } -- (size_t)writeBuffer: (char*)buf +- (size_t)writeBuffer: (uint8_t*)buf withSize: (size_t)size andNItems: (size_t)nitems { size_t ret;