MCPcopy Index your code
hub / github.com/apache/tomcat / hexLine

Method hexLine

java/org/apache/coyote/ajp/AjpMessage.java:400–418  ·  view source on GitHub ↗

Generate a hex dump line for debugging. @param buf The byte buffer @param start The starting offset @param len The current message length @return A string representation of the hex dump line

(byte[] buf, int start, int len)

Source from the content-addressed store, hash-verified

398 * @return A string representation of the hex dump line
399 */
400 protected static String hexLine(byte[] buf, int start, int len) {
401 StringBuilder sb = new StringBuilder();
402 for (int i = start; i < start + 16; i++) {
403 if (i < len + 4) {
404 sb.append(hex(buf[i])).append(' ');
405 } else {
406 sb.append(" ");
407 }
408 }
409 sb.append(" | ");
410 for (int i = start; i < start + 16 && i < len + 4; i++) {
411 if (!Character.isISOControl((char) buf[i])) {
412 sb.append(Character.valueOf((char) buf[i]));
413 } else {
414 sb.append('.');
415 }
416 }
417 return sb.toString();
418 }
419
420
421 /**

Callers 1

dumpMethod · 0.95

Calls 4

hexMethod · 0.95
toStringMethod · 0.65
appendMethod · 0.45
valueOfMethod · 0.45

Tested by

no test coverage detected