      - parameter options:    Options for handling invalid input
      - returns:              The decoded bytes.
      */
-    private static func base64DecodeBytes<T: Collection>(_ bytes: T, options: Base64DecodingOptions = []) -> UnsafeMutableRawBufferPointer? where T.Element == UInt8 {
+    private static func base64DecodeBytes(_ bytes: UnsafeRawBufferPointer, options: Base64DecodingOptions = []) -> UnsafeMutableRawBufferPointer? {
 
         // This table maps byte values 0-127, input bytes >127 are always invalid.
         // Map the ASCII characters "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" -> 0...63


    /// Initializes a data object with the given Base64 encoded data.
    public init?(base64Encoded base64Data: Data, options: Base64DecodingOptions = []) {
        guard var decodedBytes = NSData.base64DecodeBytes(base64Data, options: options) else {
            return nil
        }
        super.init()


    /// Initializes a data object with the given Base64 encoded string.
    public init?(base64Encoded base64String: String, options: Base64DecodingOptions = []) {

        let result: UnsafeMutableRawBufferPointer?
        if let _result = base64String.utf8.withContiguousStorageIfAvailable({ buffer -> UnsafeMutableRawBufferPointer? in
            let rawBuffer = UnsafeRawBufferPointer(start: buffer.baseAddress!, count: buffer.count)
            return NSData.base64DecodeBytes(rawBuffer, options: options)
        }) {
            result = _result
        } else {
            // Slow path, unlikely that withContiguousStorageIfAvailable will fail but if it does, fall back to .utf8CString.
            // This will allocate and copy but it is the simplest way to get a contiguous buffer.
            result = base64String.utf8CString.withUnsafeBufferPointer { buffer -> UnsafeMutableRawBufferPointer? in
                let rawBuffer = UnsafeRawBufferPointer(start: buffer.baseAddress!, count: buffer.count - 1) // -1 to ignore the terminating NUL
                return NSData.base64DecodeBytes(rawBuffer, options: options)
            }
        }
        guard let decodedBytes = result else { return nil }
        super.init()
        _init(bytes: decodedBytes.baseAddress!, length: decodedBytes.count, copy: false, deallocator: { (ptr, length) in
            ptr.deallocate()
