             disconnectStream(nil)
         }
     }
-    //work around for a swift bug. BugID: 17712659
-    func workaroundMethod() {
-        //does nothing, but fixes bug in swift
-    }
     //disconnect the stream object
     private func disconnectStream(error: NSError?) {
         if writeQueue != nil {

            if((isMasked > 0 || (RSVMask & buffer[0]) > 0) && receivedOpcode != OpCode.Pong.rawValue) {
                let errCode = CloseCode.ProtocolError.rawValue
                let error = self.errorWithDetail("masked and rsv data is not currently supported", code: errCode)
                if let failBlock = self._failureBlock{
                    failBlock(error)
                }
                else{
                    self.delegate!.websocketDidDisconnect(error)
                }
                writeError(errCode)
                    
                return

                let writeBuffer = UnsafePointer<UInt8>(frame!.bytes+total)
                var len = self.outputStream!.write(writeBuffer, maxLength: offset-total)
                if len < 0 {
                    if let disconnect = self.disconnectedBlock {
                        disconnect(self.outputStream!.streamError!)
                    }
                    self.delegate?.websocketDidDisconnect(self.outputStream!.streamError)
                    break
                } else {
                    total += len
