MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / copyOf

Method copyOf

vm/JavaAPI/src/java/util/Arrays.java:3700–3708  ·  view source on GitHub ↗
(T[] original, int newLength,  Class<? extends T[]> newType)

Source from the content-addressed store, hash-verified

3698 }
3699
3700 public static <T> T[] copyOf(T[] original, int newLength, Class<? extends T[]> newType) {
3701 if (newLength < 0) {
3702 throw new NegativeArraySizeException("copyOf expects newLength >= 0, but found "+newLength);
3703 }
3704 T[] arr = (T[])Array.newInstance(newType.getComponentType(), newLength);
3705 int len = Math.min(original.length, newLength);
3706 System.arraycopy(original, 0, arr, 0, len);
3707 return arr;
3708 }
3709
3710 public static <T> T[] copyOf(T[] original, int newLength) {
3711 if (newLength < 0) {

Callers 15

guessMimeTypeMethod · 0.95
castArrayMethod · 0.95
runTranslatorMethod · 0.95
runTranslatorImplMethod · 0.95
extractRleMethod · 0.95
putFileMethod · 0.95
getFileContentMethod · 0.95
getSSLCertificatesMethod · 0.95
setSslCertificatesMethod · 0.95
fromRgbMethod · 0.95
openInputStreamMethod · 0.95

Calls 6

newInstanceMethod · 0.95
minMethod · 0.95
arraycopyMethod · 0.95
copyOfRangeMethod · 0.95
getComponentTypeMethod · 0.65
getClassMethod · 0.45

Tested by 15

runTranslatorMethod · 0.76
runTranslatorImplMethod · 0.76
putFileMethod · 0.76
getFileContentMethod · 0.76
getSSLCertificatesMethod · 0.76
setSslCertificatesMethod · 0.76
fromRgbMethod · 0.76
openInputStreamMethod · 0.76
setInputDataMethod · 0.76
getInputDataMethod · 0.76
AudioCaptureFrameMethod · 0.76