     }
 
     init(protobuf: Data) throws {
-        try self.init(protobufBytes: [UInt8](protobuf), extensions: nil)
+        try self.init(protobuf: protobuf, extensions: nil)
     }
 
     init(protobuf: Data, extensions: ProtobufExtensionSet? = nil) throws {
-        try self.init(protobufBytes: [UInt8](protobuf), extensions: extensions)
+        self.init()
+        // We need to gracefully handle empty data, because the pointer passed into withUnsafeBytes'
+        // closure will be nil in that case.
+        guard !protobuf.isEmpty else {
+            return
+        }
+        try protobuf.withUnsafeBytes { (pointer: UnsafePointer<UInt8>) in
+            let bufferPointer = UnsafeBufferPointer<UInt8>(start: pointer, count: protobuf.count)
+            try decodeIntoSelf(from: bufferPointer, extensions: extensions)
+        }
     }
 
     init(protobufBytes: [UInt8]) throws {

    }
    init(protobufBytes: [UInt8], extensions: ProtobufExtensionSet? = nil) throws {
        self.init()
        try protobufBytes.withUnsafeBufferPointer { (bp) in
            var protobufDecoder = ProtobufBinaryDecoder(protobufPointer: bp, extensions: extensions)
            try protobufDecoder.decodeFullObject(message: &self)
        }
    }


    }
    init(protobufBuffer: UnsafeBufferPointer<UInt8>, extensions: ProtobufExtensionSet? = nil) throws {
        self.init()
        try decodeIntoSelf(from: protobufBuffer, extensions: extensions)
    }
    private mutating func decodeIntoSelf(from bufferPointer: UnsafeBufferPointer<UInt8>, extensions: ProtobufExtensionSet?) throws {
        var protobufDecoder = ProtobufBinaryDecoder(protobufPointer: bufferPointer, extensions: extensions)
        try protobufDecoder.decodeFullObject(message: &self)
    }
}
