MCPcopy Create free account
hub / github.com/ReadyTalk/avian / getBytes

Method getBytes

classpath/java/lang/String.java:426–445  ·  view source on GitHub ↗
(int srcOffset, int srcLength,
                       byte[] dst, int dstOffset)

Source from the content-addressed store, hash-verified

424 }
425
426 public void getBytes(int srcOffset, int srcLength,
427 byte[] dst, int dstOffset)
428 {
429 if (srcOffset < 0)
430 throw new StringIndexOutOfBoundsException(srcOffset);
431 else if (srcOffset + srcLength > length)
432 throw new StringIndexOutOfBoundsException(srcOffset + srcLength);
433 else if (srcLength < 0)
434 throw new StringIndexOutOfBoundsException(srcLength);
435
436 if (data instanceof char[]) {
437 char[] src = (char[]) data;
438 for (int i = 0; i < srcLength; ++i) {
439 dst[i + dstOffset] = (byte) src[i + offset + srcOffset];
440 }
441 } else {
442 byte[] src = (byte[]) data;
443 System.arraycopy(src, offset + srcOffset, dst, dstOffset, srcLength);
444 }
445 }
446
447 public byte[] getBytes() {
448 try {

Callers 15

mainMethod · 0.95
createZipMethod · 0.95
mainMethod · 0.80
testMethod · 0.80
testFailedBindMethod · 0.80
testMethod · 0.80
runMethod · 0.80
writeToMethod · 0.80
getNameMethod · 0.80
StaticClass · 0.80
printMethod · 0.80
printlnMethod · 0.80

Calls 6

arraycopyMethod · 0.95
encodeMethod · 0.95
encodeMethod · 0.95
equalsMethod · 0.65
toUpperCaseMethod · 0.45
trimMethod · 0.45

Tested by 6

mainMethod · 0.76
createZipMethod · 0.76
mainMethod · 0.64
testMethod · 0.64
testFailedBindMethod · 0.64
testMethod · 0.64