     public var isConnected: Bool {
         return connected
     }
-    
+
     public var currentURL: URL { return url }
-    
+
     // MARK: - Private
     private var url: URL
     private var inputStream: InputStream?

        var frameCount = 0
        var buffer: NSMutableData?
    }
    
    // MARK: - Delegates
    /// Responds to callback about new messages coming in over the WebSocket
    /// and also connection/disconnect messages.
    public weak var delegate: WebSocketDelegate?
    
    /// Receives a callback for each pong message recived.
    public weak var pongDelegate: WebSocketPongDelegate?
    
    
    // MARK: - Block based API.
    public var onConnect: ((Void) -> Void)?
    public var onDisconnect: ((NSError?) -> Void)?
    public var onText: ((String) -> Void)?
    public var onData: ((Data) -> Void)?
    public var onPong: ((Data?) -> Void)?
    
    public var headers = [String: String]()
    public var voipEnabled = false
    public var disableSSLCertValidation = false

            buffer[offset + i] = UInt8((value >> (8*UInt64(7 - i))) & 0xff)
        }
    }

    /**
     Process one message at the start of `buffer`. Return another buffer (sharing storage) that contains the leftover contents of `buffer` that I didn't process.
     */
