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

Method join

output/java_guava/1.4.18/UnsignedBytes.java:261–274  ·  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

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