 
     /// 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 {
+        guard let decodedBytes = base64Data.withUnsafeBytes({ rawBuffer in
+                NSData.base64DecodeBytes(rawBuffer, options: options)
+        }) else {
             return nil
         }
         super.init()


    /// Initializes a data object with the given Base64 encoded string.
    public init?(base64Encoded base64String: String, options: Base64DecodingOptions = []) {
        guard var decodedBytes = NSData.base64DecodeBytes(base64String.utf8, options: options) else {
            return nil
        }
        super.init()
        _init(bytes: decodedBytes.baseAddress!, length: decodedBytes.count, copy: false, deallocator: { (ptr, length) in
            ptr.deallocate()

     - parameter options:    Options for handling invalid input
     - returns:              The decoded bytes.
     */
    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
