         if let bodyPartError = bodyPartError {
             throw bodyPartError
         }
-
 
         if FileManager.default.fileExists(atPath: fileURL.path) {
             let failureReason = "A file already exists at the given file URL: \(fileURL)"

        bodyParts.last?.hasFinalBoundary = true

        for bodyPart in bodyParts {
            let encodedData = try encodeBodyPart(bodyPart)
            encoded.append(encodedData)
        }


    }

    private func writeHeaderData(for bodyPart: BodyPart, to outputStream: NSOutputStream) throws {
        let headerData = encodeHeaders(for: bodyPart)
        return try write(headerData, to: outputStream)
    }

