/** Read the given byte buffer into a Byte array */ public static byte[] readBytes(ByteBuffer buffer) { return Utils.readBytes(buffer, 0, buffer.limit()); }
public static String readFileAsString(String path) throws IOException { return Utils.readFileAsString(path, Charset.defaultCharset()); }
/** * Look up the class by name and instantiate it. * * @param klass class name * @param base super class of the class to be instantiated * @param <T> * @return the new instance */ public static <T> T newInstance(String klass, Class<T> base) throws ClassNotFoundException { return Utils.newInstance( Class.forName(klass, true, Utils.getContextOrKafkaClassLoader()).asSubclass(base)); }