496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
|
tmp = [self allocMemoryWithSize: itemSize
count: count];
@try {
[self readIntoBuffer: tmp
exactLength: count * itemSize];
[dataArray addItemsFromCArray: tmp
count: count];
} @finally {
[self freeMemory: tmp];
}
return dataArray;
}
|
|
|
|
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
|
tmp = [self allocMemoryWithSize: itemSize
count: count];
@try {
[self readIntoBuffer: tmp
exactLength: count * itemSize];
[dataArray addItems: tmp
count: count];
} @finally {
[self freeMemory: tmp];
}
return dataArray;
}
|
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
|
@try {
while (![self isAtEndOfStream]) {
size_t length;
length = [self readIntoBuffer: buffer
length: of_pagesize];
[dataArray addItemsFromCArray: buffer
count: length];
}
} @finally {
[self freeMemory: buffer];
}
return dataArray;
}
|
|
|
|
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
|
@try {
while (![self isAtEndOfStream]) {
size_t length;
length = [self readIntoBuffer: buffer
length: of_pagesize];
[dataArray addItems: buffer
count: length];
}
} @finally {
[self freeMemory: buffer];
}
return dataArray;
}
|
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
|
return size;
}
- (size_t)writeDataArray: (OFDataArray*)dataArray
{
size_t length = [dataArray count] * [dataArray itemSize];
[self writeBuffer: [dataArray cArray]
length: length];
return [dataArray count] * [dataArray itemSize];
}
- (size_t)writeString: (OFString*)string
{
size_t length = [string UTF8StringLength];
[self writeBuffer: [string UTF8String]
|
|
|
|
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
|
return size;
}
- (size_t)writeDataArray: (OFDataArray*)dataArray
{
size_t length = [dataArray count] * [dataArray itemSize];
[self writeBuffer: [dataArray items]
length: length];
return length;
}
- (size_t)writeString: (OFString*)string
{
size_t length = [string UTF8StringLength];
[self writeBuffer: [string UTF8String]
|