MCPcopy Create free account
hub / github.com/antlr/codebuff / join

Method join

output/java_guava/1.4.19/UnsignedBytes.java:262–275  ·  view source on GitHub ↗

Returns a string containing the supplied byte values separated by separator. For example, join(":", (byte) 1, (byte) 2, (byte) 255) returns the string "1:2:255". @param separator the text that should appear between consecutive values in the resulting string (but

(String separator, byte... array)

Source from the content-addressed store, hash-verified

260
261
262 public static String join(String separator, byte... array) {
263 checkNotNull(separator);
264 if (array.length == 0) {
265 return "";
266 }
267
268 // For pre-sizing a builder, just get the right order of magnitude
269 StringBuilder builder = new StringBuilder(array.length * (3 + separator.length()));
270 builder.append(toInt(array[0]));
271 for (int i = 1; i < array.length; i++) {
272 builder.append(separator).append(toString(array[i]));
273 }
274 return builder.toString();
275 }
276
277 /**
278 * Returns a comparator that compares two {@code byte} arrays <a

Callers

nothing calls this directly

Calls 6

toIntMethod · 0.95
toStringMethod · 0.95
toStringMethod · 0.65
checkNotNullMethod · 0.45
lengthMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected