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