code: private Object openOrRead(final String path, final boolean open) throws SecurityException {
          final String methodName = open ? "open" : "read";
          final Object /* Optional<InputStream> */ optionalInputStream = ReflectionUtils.invokeMethod(moduleReader,
                  methodName, String.class, path, /* throwException = */ true);
          if (optionalInputStream == null) {
              throw new IllegalArgumentException("Got null result from moduleReader." + methodName + "(name)");
          }
          final Object /* InputStream */ inputStream = ReflectionUtils.invokeMethod(optionalInputStream, "get",
                  /* throwException = */ true);
          if (inputStream == null) {
              throw new IllegalArgumentException("Got null result from moduleReader." + methodName + "(name).get()");
          }
          return inputStream;
      }
docs: Use the proxied ModuleReader to open the named resource as an InputStream.
  
  @param path
  The path to the resource to open.
  @param open
  if true, call moduleReader.open(name).get() (returning an InputStream), otherwise call
  moduleReader.read(name).get() (returning a ByteBuffer).
  @return An {@link InputStream} for the content of the resource.
  @throws SecurityException
  If the module cannot be accessed.