OSDN Git Service

add ui16be method
authorYoshihiro Yamazaki <yoya@awm.jp>
Tue, 4 Dec 2012 09:33:49 +0000 (18:33 +0900)
committerYoshihiro Yamazaki <yoya@awm.jp>
Tue, 4 Dec 2012 09:33:49 +0000 (18:33 +0900)
src/ibit.js

index 5c71ed1..f8ea108 100644 (file)
@@ -138,6 +138,11 @@ FlappIBit.prototype = {
             (this.data[this.byteOffset++] << 16) |
             (this.data[this.byteOffset++] << 24);
     },
+    ui16be: function() { // unsigned 16-bit integer
+       this.a();
+       return (this.data[this.byteOffset++] << 8) |
+           this.data[this.byteOffset++];
+    },
     sub: function(len) {
         this.a();
         var data = this.data.subarray(this.byteOffset, this.byteOffset + len);