MCPcopy Create free account
hub / github.com/apache/poi / arraycopy

Method arraycopy

src/java/org/apache/poi/util/ArrayUtil.java:32–48  ·  view source on GitHub ↗

This is really a debugging version of System.arraycopy() . Use it to provide better exception messages when copying arrays around. For production use it's better to use the original for speed.

(byte[] src, int src_position, byte[] dst, int dst_position, int length)

Source from the content-addressed store, hash-verified

30 * For production use it's better to use the original for speed.
31 */
32 public static void arraycopy(byte[] src, int src_position, byte[] dst, int dst_position, int length)
33 {
34 if (src_position < 0)
35 throw new IllegalArgumentException("src_position was less than 0. Actual value " + src_position);
36 if (src_position >= src.length)
37 throw new IllegalArgumentException( "src_position was greater than src array size. Tried to write starting at position " + src_position + " but the array length is " + src.length );
38 if (src_position + length > src.length)
39 throw new IllegalArgumentException("src_position + length would overrun the src array. Expected end at " + (src_position + length) + " actual end at " + src.length);
40 if (dst_position < 0)
41 throw new IllegalArgumentException("dst_position was less than 0. Actual value " + dst_position);
42 if (dst_position >= dst.length)
43 throw new IllegalArgumentException( "dst_position was greater than dst array size. Tried to write starting at position " + dst_position + " but the array length is " + dst.length );
44 if (dst_position + length > dst.length)
45 throw new IllegalArgumentException("dst_position + length would overrun the dst array. Expected end at " + (dst_position + length) + " actual end at " + dst.length);
46
47 System.arraycopy( src, src_position, dst, dst_position, length);
48 }
49
50 /**
51 * Moves a number of entries in an array to another point in the array,

Callers 15

writeDataMethod · 0.95
testarraycopyMethod · 0.95
readMethod · 0.80
fixUpMethod · 0.80
flushMethod · 0.80
fillFieldsMethod · 0.80
serializeMethod · 0.80
fillFieldsMethod · 0.80
serializeMethod · 0.80
fillFieldsMethod · 0.80
serializeMethod · 0.80
fillFieldsMethod · 0.80

Calls

no outgoing calls

Tested by 15

testarraycopyMethod · 0.76
cloneMethod · 0.64
testStoreMethod · 0.64
testConstructMethod · 0.64
cutMethod · 0.64
concatMethod · 0.64
testReadContinuedMethod · 0.64
testCreateURLRecordMethod · 0.64
testCreateFileRecordMethod · 0.64