Skip to content

Commit 4e0a7dd

Browse files
committed
Add documentation for Lsb/MsbBitReader.advance(by:) functions
1 parent 5e66fa9 commit 4e0a7dd

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Sources/LsbBitReader.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ public final class LsbBitReader: ByteReader, BitReader {
4242
self.offset = byteReader.offset
4343
}
4444

45+
/**
46+
Advances reader's BIT pointer by specified amount of bits (default is 1).
47+
48+
- Warning: Doesn't check if there is any data left. It is advised to use `isFinished` AFTER calling this method
49+
to check if the end was reached.
50+
*/
4551
public func advance(by count: Int = 1) {
4652
for _ in 0..<count {
4753
if self.bitMask == 128 {

Sources/MsbBitReader.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ public final class MsbBitReader: ByteReader, BitReader {
4242
self.offset = byteReader.offset
4343
}
4444

45+
/**
46+
Advances reader's BIT pointer by specified amount of bits (default is 1).
47+
48+
- Warning: Doesn't check if there is any data left. It is advised to use `isFinished` AFTER calling this method
49+
to check if the end was reached.
50+
*/
4551
public func advance(by count: Int = 1) {
4652
for _ in 0..<count {
4753
if self.bitMask == 1 {

0 commit comments

Comments
 (0)