ObjFW  Diff

Differences From Artifact [e5c693e728]:

To Artifact [504d17c5e3]:


212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
		buffer = malloc(size);
		if (buffer == NULL)
			@throw [OFOutOfMemoryException
			    exceptionWithRequestedSize: size];

		@try {
			OFFile *file = [[OFFile alloc] initWithPath: path
							       mode: @"rb"];
			@try {
				[file readIntoBuffer: buffer
					 exactLength: size];
			} @finally {
				[file release];
			}








|







212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
		buffer = malloc(size);
		if (buffer == NULL)
			@throw [OFOutOfMemoryException
			    exceptionWithRequestedSize: size];

		@try {
			OFFile *file = [[OFFile alloc] initWithPath: path
							       mode: @"r"];
			@try {
				[file readIntoBuffer: buffer
					 exactLength: size];
			} @finally {
				[file release];
			}

590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
	return of_base64_encode(_items, _count * _itemSize);
}

#ifdef OF_HAVE_FILES
- (void)writeToFile: (OFString *)path
{
	OFFile *file = [[OFFile alloc] initWithPath: path
					       mode: @"wb"];

	@try {
		[file writeBuffer: _items
			   length: _count * _itemSize];
	} @finally {
		[file release];
	}







|







590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
	return of_base64_encode(_items, _count * _itemSize);
}

#ifdef OF_HAVE_FILES
- (void)writeToFile: (OFString *)path
{
	OFFile *file = [[OFFile alloc] initWithPath: path
					       mode: @"w"];

	@try {
		[file writeBuffer: _items
			   length: _count * _itemSize];
	} @finally {
		[file release];
	}