kilim.http.Utils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kilim Show documentation
Show all versions of kilim Show documentation
Coroutines, continuations, fibers, actors and message passing for the JVM
/* Copyright (c) 2006, Sriram Srinivasan
*
* You may distribute this software under the terms of the license
* specified in the file "License"
*/
package kilim.http;
import java.lang.reflect.Array;
public class Utils {
public static Object[] growArray(Object[] input, int extraRoom) {
int size = input.length + extraRoom;
Object[] ret = (Object[]) Array.newInstance(input.getClass().getComponentType(), size);
System.arraycopy(input,0,ret,0,input.length);
return ret;
}
public static int[] growArray(int[] input, int extraRoom) {
int size = input.length + extraRoom;
int[] ret = (int[]) Array.newInstance(input.getClass().getComponentType(), size);
System.arraycopy(input,0,ret,0,input.length);
return ret;
}
}