         return nil
     }
 
-    public func getNextBits(_ bitsToRead : UInt8 ) -> UInt64! {
+    public func getNextBits(_ bitsToRead: UInt8 ) -> UInt64! {
         if bitsToRead > 64 {
             return nil
         }
 
         var bitsLeft = bitsToRead
-        var combinedValue : UInt64 = 0
+        var combinedValue: UInt64 = 0
         while bitsLeft > 0 {
             let bit = getNextBit()
             if bit == nil {

        bitsLeftInWriteBuffer -= 1
    }

    public func setNextBits(_ bitsToWrite : UInt8, from bits: UInt64) {
        if( bitsToWrite > 64 ) {
            return
        }

        var shiftedBits = bits << (64-bitsToWrite.toU64)
        var bitsLeftToWrite = bitsToWrite
        while bitsLeftToWrite > 0 {
            let bit = shiftedBits >> 63

        return combinedValue
    }

    public func setNextBit(_ bit: UInt8 ) {
        if( bitsLeftInWriteBuffer == 0 ) {
            data.append(writeBuffer)
            writeBuffer = 0
