Differences From Artifact [8adcdb3a6b]:
- File
src/OFInflateStream.m
— part of check-in
[2e9336b1ef]
at
2015-05-16 20:29:57
on branch trunk
— Rename OFDeflateStream -> OFInflateStream
It makes more sense to have one class for inflating and one for
deflating instead of having one that does both, as having one that does
both requires more memory per instance when only inflating or deflating
is used. (user: js, size: 18858) [annotate] [blame] [check-ins using]
To Artifact [4aad919281]:
- File src/OFInflateStream.m — part of check-in [3f1d13fa45] at 2016-05-29 14:48:10 on branch 0.8 — OFInflate64Stream: Fix window size (user: js, size: 18935) [annotate] [blame] [check-ins using]
1 | /* | | | | 1 2 3 4 5 6 7 8 9 10 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 * Jonathan Schleifer <js@heap.zone> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * |
︙ | ︙ | |||
280 281 282 283 284 285 286 | #ifndef DEFLATE64 + (instancetype)streamWithStream: (OFStream*)stream { return [[[self alloc] initWithStream: stream] autorelease]; } | < < < < < | < < > > > > > > > > > > > > > > | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | #ifndef DEFLATE64 + (instancetype)streamWithStream: (OFStream*)stream { return [[[self alloc] initWithStream: stream] autorelease]; } - initWithStream: (OFStream*)stream { self = [self init]; _stream = [stream retain]; return self; } - (void)dealloc { [_stream release]; [super dealloc]; } #endif - init { self = [super init]; _bitIndex = 8; /* 0-7 address the bit, 8 means fetch next byte */ #ifdef DEFLATE64 _slidingWindowMask = 0xFFFF; #else _slidingWindowMask = 0x7FFF; #endif return self; } - (size_t)lowlevelReadIntoBuffer: (void*)buffer_ length: (size_t)length { uint8_t *buffer = buffer_; uint_fast16_t bits, i, tmp; uint16_t value; |
︙ | ︙ |