Permalink
Browse files

add reverse bit addition

  • Loading branch information...
1 parent 3e86fa8 commit eaafba7b0dbb487c1b735db2c27525dba31b5e62 @kkaefer committed Jun 3, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 bitstream.js
View
@@ -161,6 +161,12 @@ Bitstream.prototype.writeUnsignedLE = function(number, length) {
}
};
+Bitstream.prototype.writeUnsignedReversed = function(number, length) {
+ for (var shift = length - 1; shift >= 0; shift--) {
+ this.writeUnsigned(number >> shift, 1);
+ }
+};
+
Bitstream.prototype.end = function() {
this.align();

0 comments on commit eaafba7

Please sign in to comment.