 
     private func extractMaskingKey() throws -> MaskingKey {
         guard
-            let zero = try next(),
-            let one = try next(),
-            let two = try next(),
-            let three = try next()
+            let zero = try buffer.next(),
+            let one = try buffer.next(),
+            let two = try buffer.next(),
+            let three = try buffer.next()
             else {
                 throw "536: WebSockets.Swift: MessageParser"
         }

            }
        }
    }
}

extension MessageParser {

    private func extractExtendedPayloadLength(_ length: ExtendedPayloadByteLength) throws -> UInt64 {
        var bytes: [Byte] = []
        for _ in 1...length.rawValue {
            guard let next = try buffer.next() else {
                throw "522: WebSockets.Swift: MessageParser"
            }
            bytes.append(next)
