         try parse() // Drop YAML_STREAM_START_EVENT
     }
 
+    func startParse(with buffer: UnsafeBufferPointer<UInt8>) throws {
+        yaml_parser_set_input_string(&parser, buffer.baseAddress, buffer.count)
+        try parse() // Drop YAML_STREAM_START_EVENT
+    }
+
     @discardableResult
     func parse() throws -> Event {
         let event = Event()

    private var parser = yaml_parser_t()

    private enum Buffer {
        case utf8(ArraySlice<CChar>)
        case utf16(Data)
    }
    private let buffer: Buffer
}

// MARK: Implementation Details

    }
}
#endif

#if swift(>=4.2)
#if !compiler(>=5)
private extension String.UTF8View {
    func withContiguousStorageIfAvailable<R>(_ body: (UnsafeBufferPointer<Element>) throws -> R) rethrows -> R? {
        return nil
    }
}
#endif
#else
private extension String.UTF8View {
    func withContiguousStorageIfAvailable<R>(_ body: (UnsafeBufferPointer<Element>) throws -> R) rethrows -> R? {
        return nil
    }
}
#endif
