         case .straight:
             self.bitMask = 128
         }
+    }
+
+    convenience init(data: Data, bitOrder: BitOrder) {
+        var array = data.toArray(type: UInt8.self)
+        self.init(array: &array, bitOrder: bitOrder)
     }
 
     func bits(count: Int) -> [UInt8] {


class DataWithPointer {

    private let bitOrder: BitOrder
    private let bitArray: [UInt8]
    var index: Int = 0
    private(set) var bitMask: UInt8

    init(data: Data, bitOrder: BitOrder) {
        self.bitOrder = bitOrder
        self.bitArray = data.toArray(type: UInt8.self)

        switch self.bitOrder {
        case .reversed:

        return result
    }

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

    // MARK: Manipulations with index and bitShift

    func skipUntilNextByte() {
