code: public static <T> InputReader getInstance(T input, int size, Charset cs, Set<ParserFeature> features) throws IOException
      {
          try
          {
              Class<?> inputClass = input.getClass();
              MethodHandle mh = inputMap.get(inputClass);
              if (mh != null)
              {
                  return (InputReader) mh.invoke(input, size, cs, features);
              }
              else
              {
                  for (Entry<Class<?>,MethodHandle> e : inputMap.entrySet())
                  {
                      if (e.getKey().isAssignableFrom(inputClass))
                      {
                          mh = e.getValue();
                          break;
                      }
                  }
                  if (mh == null)
                  {
                      throw new IOException(input+" not assignable to any of "+inputMap.keySet());
                  }
              }
              return (InputReader) mh.invoke(input, size, cs, features);
          }
          catch (Throwable ex)
          {
              if (ex instanceof IOException)
              {
                  throw (IOException)ex;
              }
              else
              {
                  throw new IOException(ex);
              }
          }
      }
docs: Returns InputReader for input
  @param <T>
  @param input Any supported input type
  @param size Ring-buffer size
  @param cs Character set
  @param features Needed features
  @return
  @throws IOException