com.nimbusds.jose.util.ArrayUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nimbus-jose-jwt Show documentation
Show all versions of nimbus-jose-jwt Show documentation
Java library for Javascript Object Signing and Encryption (JOSE) and
JSON Web Tokens (JWT)
package com.nimbusds.jose.util;
import java.util.Arrays;
/**
* Array utilities.
*/
public class ArrayUtils {
/**
* Concatenates the specified arrays.
*
* @param first The first array. Must not be {@code null}.
* @param rest The remaining arrays.
* @param The array type.
*
* @return The resulting array.
*/
public static T[] concat(final T[] first, final T[]... rest) {
int totalLength = first.length;
for (T[] array : rest) {
totalLength += array.length;
}
T[] result = Arrays.copyOf(first, totalLength);
int offset = first.length;
for (T[] array : rest) {
System.arraycopy(array, 0, result, offset, array.length);
offset += array.length;
}
return result;
}
/**
* Prevents public instantiation.
*/
private ArrayUtils() {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy