16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#include "config.h"
#include <string.h>
#import "OFLHAArchiveEntry.h"
#import "OFLHAArchiveEntry+Private.h"
#import "OFArray.h"
#import "OFData.h"
#import "OFDate.h"
#import "OFNumber.h"
#import "OFStream.h"
#import "OFString.h"
#import "crc16.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfRangeException.h"
#import "OFUnsupportedVersionException.h"
@implementation OFLHAArchiveEntry
static OFDate *
|
>
<
<
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#include "config.h"
#include <string.h>
#import "OFLHAArchiveEntry.h"
#import "OFLHAArchiveEntry+Private.h"
#import "OFArray.h"
#import "OFCRC16.h"
#import "OFData.h"
#import "OFDate.h"
#import "OFNumber.h"
#import "OFStream.h"
#import "OFString.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfRangeException.h"
#import "OFUnsupportedVersionException.h"
@implementation OFLHAArchiveEntry
static OFDate *
|
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
|
if (headerSize > UINT16_MAX)
@throw [OFOutOfRangeException exception];
/* Now fill in the size and CRC16 for the entire header */
tmp16 = OFToLittleEndian16(headerSize);
memcpy([data mutableItemAtIndex: 0], &tmp16, sizeof(tmp16));
tmp16 = of_crc16(0, data.items, data.count);
tmp16 = OFToLittleEndian16(tmp16);
memcpy([data mutableItemAtIndex: 27], &tmp16, sizeof(tmp16));
[stream writeData: data];
objc_autoreleasePoolPop(pool);
}
|
|
|
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
|
if (headerSize > UINT16_MAX)
@throw [OFOutOfRangeException exception];
/* Now fill in the size and CRC16 for the entire header */
tmp16 = OFToLittleEndian16(headerSize);
memcpy([data mutableItemAtIndex: 0], &tmp16, sizeof(tmp16));
tmp16 = OFCRC16(0, data.items, data.count);
tmp16 = OFToLittleEndian16(tmp16);
memcpy([data mutableItemAtIndex: 27], &tmp16, sizeof(tmp16));
[stream writeData: data];
objc_autoreleasePoolPop(pool);
}
|