You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/LsbBitWriter.swift
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,23 @@ public final class LsbBitWriter: BitWriter {
54
54
mask <<=1
55
55
}
56
56
}
57
+
58
+
/**
59
+
Writes `number`, using and advancing by `bitsCount` BIT positions.
57
60
61
+
- Note: If `bitsCount` is smaller than the actual amount of `number`'s bits than the `number` will be truncated to
62
+
fit into `bitsCount` amount of bits.
63
+
- Note: Bits of `number` are processed using the same bit-numbering scheme as of the writer (i.e. "LSB 0").
64
+
- Note: This method is specifically useful when needing to write a UInt64 which can overflow and crash if converting to an Int when using the regular `write` method
Copy file name to clipboardExpand all lines: Sources/MsbBitWriter.swift
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,22 @@ public final class MsbBitWriter: BitWriter {
54
54
mask >>=1
55
55
}
56
56
}
57
+
58
+
/**
59
+
Writes `number`, using and advancing by `bitsCount` BIT positions.
60
+
61
+
- Note: If `bitsCount` is smaller than the actual amount of `number`'s bits than the `number` will be truncated to
62
+
fit into `bitsCount` amount of bits.
63
+
- Note: Bits of `number` are processed using the same bit-numbering scheme as of the writer (i.e. "MSB 0").
64
+
- Note: This method is specifically useful when needing to write a UInt64 which can overflow and crash if converting to an Int when using the regular `write` method
0 commit comments