MCPcopy Create free account
hub / github.com/apache/kafka / utf8

Method utf8

clients/src/main/java/org/apache/kafka/common/utils/Utils.java:37–43  ·  view source on GitHub ↗

Turn the given UTF8 byte array into a string @param bytes The byte array @return The string

(byte[] bytes)

Source from the content-addressed store, hash-verified

35 * @return The string
36 */
37 public static String utf8(byte[] bytes) {
38 try {
39 return new String(bytes, "UTF8");
40 } catch (UnsupportedEncodingException e) {
41 throw new RuntimeException("This shouldn't happen.", e);
42 }
43 }
44
45 /**
46 * Turn a string into a utf8 byte[]

Callers 2

writeMethod · 0.95
readMethod · 0.95

Calls 1

getBytesMethod · 0.45

Tested by

no test coverage detected