Ejemplo n.º 1
0
 /** Read the given byte buffer into a Byte array */
 public static byte[] readBytes(ByteBuffer buffer) {
   return Utils.readBytes(buffer, 0, buffer.limit());
 }
Ejemplo n.º 2
0
 public static String readFileAsString(String path) throws IOException {
   return Utils.readFileAsString(path, Charset.defaultCharset());
 }
Ejemplo n.º 3
0
 /**
  * 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));
 }