         self.skipUntilNextByte()
         var result: UInt64 = 0
         for i: UInt64 in 0..<count {
-            result |= UInt64(self.bitArray[self.index]) << (8 * i)
+            result |= UInt64(self.data[self.index]) << (8 * i)
             self.index += 1
         }
         return result

    }

    func bit() -> Int {
        let bit = self.bitArray[self.index] & self.bitMask > 0 ? 1 : 0

        switch self.bitOrder {
        case .reversed:

        self.skipUntilNextByte()
        var result: UInt32 = 0
        for i: UInt32 in 0..<count {
            result |= UInt32(self.data[self.index]) << (8 * i)
            self.index += 1
        }
        return result
