All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nimbusds.jose.util.StringUtils Maven / Gradle / Ivy

Go to download

Java library for Javascript Object Signing and Encryption (JOSE) and JSON Web Tokens (JWT)

There is a newer version: 10.0.1
Show newest version
package com.nimbusds.jose.util;


import java.nio.charset.Charset;


/**
 * String utilities.
 *
 * @author Vladimir Dzhuvinov
 * @version $version$ (2013-05-16)
 */
public class StringUtils {


	/**
	 * Converts the specified string to a byte array.
	 *
	 * @param s The input string to convert. Must be UTF-8 encoded and not
	 *          {@code null}.
	 *
	 * @return The resulting byte array.
	 */
	public static byte[] toByteArray(final String s) {

		return s.getBytes(Charset.forName("UTF-8"));
	}


	/**
	 * Prevents public instantiation.
	 */
	private StringUtils() {

	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy