ObjFW  Diff

Differences From Artifact [428c033f1c]:

To Artifact [99b0bbcaa7]:


20
21
22
23
24
25
26

27
28
29
30
31

32
33


34
35
36
37
38
39
40
41

42
43
44
45





46
47
48
49
50
51
52
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61







+





+

-
+
+








+




+
+
+
+
+







#import "OFInflateStream.h"
#import "OFDate.h"

#import "crc32.h"

#import "OFChecksumFailedException.h"
#import "OFInvalidFormatException.h"
#import "OFNotImplementedException.h"
#import "OFNotOpenException.h"
#import "OFTruncatedDataException.h"

@implementation OFGZIPStream
+ (instancetype)streamWithStream: (OFStream *)stream
			    mode: (OFString *)mode
{
	return [[[self alloc] initWithStream: stream] autorelease];
	return [[[self alloc] initWithStream: stream
					mode: mode] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithStream: (OFStream *)stream
	    mode: (OFString *)mode
{
	self = [super init];

	@try {
		if (![mode isEqual: @"r"])
			@throw [OFNotImplementedException
			    exceptionWithSelector: _cmd
					   object: self];

		_stream = [stream retain];
		_CRC32 = ~0;
	} @catch (id e) {
		[self release];
		@throw e;
	}