Sorry if it's an amateur question. I cant seem to find the right answer to it. What is the android (java) equivalent of swift's:
"somestring".data(using:.utf8)
method?
Thanks a lot
EDIT:
I am creating a java version of the following method:
guard let data = "\(user):\(password)".data(using: .utf8) else { return nil }
let credential = data.base64EncodedString(options: [])
return (key: "Authorization", value: "Basic \(credential)")