@@ -29,24 +29,21 @@ @implementation OFGZIPStream @synthesize operatingSystemMadeOn = _operatingSystemMadeOn; @synthesize modificationDate = _modificationDate; -+ (instancetype)streamWithStream: (OFStream *)stream - mode: (OFString *)mode ++ (instancetype)streamWithStream: (OFStream *)stream mode: (OFString *)mode { - return [[[self alloc] initWithStream: stream - mode: mode] autorelease]; + return [[[self alloc] initWithStream: stream mode: mode] autorelease]; } - (instancetype)init { OF_INVALID_INIT_METHOD } -- (instancetype)initWithStream: (OFStream *)stream - mode: (OFString *)mode +- (instancetype)initWithStream: (OFStream *)stream mode: (OFString *)mode { self = [super init]; @try { if (![mode isEqual: @"r"]) @@ -75,12 +72,11 @@ [_modificationDate release]; [super dealloc]; } -- (size_t)lowlevelReadIntoBuffer: (void *)buffer - length: (size_t)length +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { if (_stream == nil) @throw [OFNotOpenException exceptionWithObject: self]; for (;;) { @@ -96,12 +92,11 @@ switch (_state) { case OF_GZIP_STREAM_ID1: case OF_GZIP_STREAM_ID2: case OF_GZIP_STREAM_COMPRESSION_METHOD: - if ([_stream readIntoBuffer: &byte - length: 1] < 1) + if ([_stream readIntoBuffer: &byte length: 1] < 1) return 0; if ((_state == OF_GZIP_STREAM_ID1 && byte != 0x1F) || (_state == OF_GZIP_STREAM_ID2 && byte != 0x8B) || (_state == OF_GZIP_STREAM_COMPRESSION_METHOD && @@ -109,12 +104,11 @@ @throw [OFInvalidFormatException exception]; _state++; break; case OF_GZIP_STREAM_FLAGS: - if ([_stream readIntoBuffer: &byte - length: 1] < 1) + if ([_stream readIntoBuffer: &byte length: 1] < 1) return 0; _flags = byte; _state++; break; @@ -136,20 +130,18 @@ _bytesRead = 0; _state++; break; case OF_GZIP_STREAM_EXTRA_FLAGS: - if ([_stream readIntoBuffer: &byte - length: 1] < 1) + if ([_stream readIntoBuffer: &byte length: 1] < 1) return 0; _extraFlags = byte; _state++; break; case OF_GZIP_STREAM_OPERATING_SYSTEM: - if ([_stream readIntoBuffer: &byte - length: 1] < 1) + if ([_stream readIntoBuffer: &byte length: 1] < 1) return 0; _operatingSystemMadeOn = byte; _state++; break;