10 Commits

Author SHA1 Message Date
Timofey Solomko a9b3a110fe Save byte in bit functions instead of constantly access data property 2017-08-15 12:09:13 +03:00
Timofey Solomko 5210c16cf9 Change logic of alignment requirements in byte functions of BitReader
Previously, functions like byte(), uint32(), etc had a side effect: they were silently permorming alignement (skipping all bits until next byte's boundary). I've considered this as a bad practice and now a call of align() function is required before using byte function. In addition, isAligned computed property was added to check if alignment is required.
2017-08-15 11:18:02 +03:00
Timofey Solomko 83849ce616 Swiftlint autocorrect 2017-07-16 00:16:42 +03:00
Timofey Solomko 228e499287 Use bitReader in ZIP only when necessary 2017-07-13 23:18:15 +03:00
Timofey Solomko 73e739135e Add function to BitReader which returns another BitReader with opposite bitOrder
It will be used in Zip bzip2 decompression.
2017-07-09 13:54:30 +03:00
Timofey Solomko a9cdb50e85 Remove intFromAlignedBytes function
Also changes were made to adopt this removal. This was done to improve behavior in some corner cases as well as enforce intentional usage of particular integer types.
2017-07-09 13:29:33 +03:00
Timofey Solomko 6cd86a9aef Add uint16 function to DWP and BitReader 2017-07-09 13:03:47 +03:00
Timofey Solomko 6bd66e4717 Reduce size of DWP functions' names
Also provide default values for count argmunets in uint32 and uint64 functions.
2017-07-09 12:44:03 +03:00
Timofey Solomko af90da9eba Fix misaligned bytes from BitReader
Added overrides of DWP functions which call skipUntilNextByte() before calling superclass functions therefore restoring old behavior.
2017-07-08 22:02:32 +03:00
Timofey Solomko a4cd339fc4 Separated byte and bit reading parts of DWP into distinct class 2017-07-08 22:02:26 +03:00