Creates the single.

@param reader the reader
@param debug the debug
@return the IDL proxy object
@throws IOException Signals that an I/O exception has occurred.
337933
public static IDLProxyObject createSingle(Reader reader, boolean debug) throws IOException {
        return createSingle(reader, debug, null);
    }
110812
public static Map<String, IDLProxyObject> create(String data, boolean debug, File path, boolean isUniName) {
        ProtoFile protoFile = ProtoParser.parse(DEFAULT_FILE_NAME, data);
        List<CodeDependent> cds = new ArrayList<CodeDependent>();
        try {
            return doCreate(protoFile, true, debug, path, false, null, cds, new HashMap<String, String>(), isUniName);
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
1238292
public static IDLProxyObject createSingle(Reader reader, boolean debug, File path) throws IOException {
        return createSingle(reader, debug, path, true);
    }
512413
public static <T> T load(Reader reader ) {
		Yaml yaml = createYmlObject();

		Map<String,Object> data = (Map<String, Object>) yaml.load(reader);

		try {
			reader.close();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}

		return load(data);
	}
91381
public static IDLProxyObject createSingle(InputStream is, boolean debug, File path) throws IOException {
        return createSingle(is, debug, path, true);
    }
190218
private String read(final BufferedReader reader) throws IOException {
		StringBuilder sqlBuilder = new StringBuilder();
		try {
			for (String line : reader.lines().toArray(String[]::new)) {
				sqlBuilder.append(line).append(System.lineSeparator());
			}
		} finally {
			if (reader != null) {
				reader.close();
			}
		}

		return sqlBuilder.toString();
	}
674615
public static List<String> readLines(Reader reader) throws IOException {
        IteratorClosureAdapter<String> closure = new IteratorClosureAdapter<String>(reader);
        eachLine(reader, closure);
        return closure.asList();
    }
382145
protected Reader getNextInputReader() throws IOException {
		if (iter == null) {
			return null;
		}
		if (!iter.hasNext()) {
			return null;
		}
		Object o = iter.next();
		if (o instanceof Reader) {
			return (Reader)o;
		} else if (o instanceof InputStream) {
			return new InputStreamReader((InputStream)o, "UTF-8"); //$NON-NLS-1$
		}
		return new StringReader(o.toString());
	}
688593
public static IDLProxyObject createSingle(InputStream is, boolean debug) throws IOException {
        return createSingle(is, debug, null, true);
    }
709109
public Reader create(InputStream is, String javaEncoding)
    throws UnsupportedEncodingException
  {
    if (Charset.isSupported(javaEncoding)) {
      Charset charset = Charset.forName(javaEncoding);
    
      return new InputStreamReader(is, charset);
    }
    else {
      // RSN-274, Charset doesn't support all java.io encoding
      return new InputStreamReader(is, javaEncoding);
    }
  }
218137
private static String reader2String(final Reader reader) throws IOException {

        final StringBuilder stringBuilder = new StringBuilder();

        try (BufferedReader bufferedReader = new BufferedReader(reader)) {
            String line = null;
            while ((line = bufferedReader.readLine()) != null) {
                stringBuilder.append(line);
                stringBuilder.append("\n"); // I know, if the original data
                                            // stream has no ending line feed,
                                            // this will add one...
            }
        }
        return stringBuilder.toString();
    }
662695
public ISimpleChemObjectReader createReader(InputStream input) throws IOException {
        IChemFormat format = null;
        ISimpleChemObjectReader reader = null;
        if (input instanceof GZIPInputStream) {
            format = formatFactory.guessFormat(input);
            reader = createReader(format);
            if (reader != null) {
                try {
                    reader.setReader(input);
                } catch (CDKException e1) {
                    IOException wrapper = new IOException("Exception while setting the InputStream: " + e1.getMessage());
                    wrapper.initCause(e1);
                    throw wrapper;
                }
            }
        } else {
            BufferedInputStream bistream = new BufferedInputStream(input, headerLength);
            InputStream istreamToRead = bistream; // if gzip test fails, then take default
            bistream.mark(5);
            int countRead = 0;
            byte[] abMagic = new byte[4];
            countRead = bistream.read(abMagic, 0, 4);
            bistream.reset();
            if (countRead == 4) {
                if (abMagic[0] == (byte) 0x1F && abMagic[1] == (byte) 0x8B) {
                    istreamToRead = new BufferedInputStream(new GZIPInputStream(bistream));
                }
            }
            format = formatFactory.guessFormat(istreamToRead);
            reader = createReader(format);
            if (reader != null) {
                try {
                    reader.setReader(istreamToRead);
                } catch (CDKException e1) {
                    IOException wrapper = new IOException("Exception while setting the InputStream: " + e1.getMessage());
                    wrapper.initCause(e1);
                    throw wrapper;
                }
            }
        }
        return reader;
    }
638198
public static IDLProxyObject createSingle(InputStream is, boolean debug, boolean isUniName) throws IOException {
        return createSingle(is, debug, null, isUniName);
    }
179777
public T parse(Reader reader) throws IOException {
    T bean = createBean();
    populate(bean, reader);
    return bean;
  }
432813
public Reader create(Reader input, MtasConfiguration config)
      throws IOException {
    MtasFetchData fetchData = new MtasFetchData(input);
    if (config.attributes
        .containsKey(MtasConfiguration.CHARFILTER_CONFIGURATION_TYPE)) {
      if (config.attributes.get(MtasConfiguration.CHARFILTER_CONFIGURATION_TYPE)
          .equals(VALUE_TYPE_URL)) {
        try {
          return fetchData.getUrl(
              config.attributes
                  .get(MtasConfiguration.CHARFILTER_CONFIGURATION_PREFIX),
              config.attributes
                  .get(MtasConfiguration.CHARFILTER_CONFIGURATION_POSTFIX));
        } catch (MtasParserException e) {
          log.debug(e);
          throw new IOException(e.getMessage());
        }
      } else if (config.attributes
          .get(MtasConfiguration.CHARFILTER_CONFIGURATION_TYPE)
          .equals(VALUE_TYPE_FILE)) {
        try {
          return fetchData.getFile(
              config.attributes
                  .get(MtasConfiguration.CHARFILTER_CONFIGURATION_PREFIX),
              config.attributes
                  .get(MtasConfiguration.CHARFILTER_CONFIGURATION_POSTFIX));
        } catch (MtasParserException e) {
          throw new IOException(e);
        }
      } else {
        return fetchData.getDefault();
      }
    } else {
      return fetchData.getDefault();
    }
  }
743480
static IdentityTemplateLibrary load(InputStream in) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(in));
        String line = null;
        IdentityTemplateLibrary library = new IdentityTemplateLibrary();
        while ((line = br.readLine()) != null) {
            // skip comments
            if (line.charAt(0) == '#') continue;
            library.add(decodeEntry(line));
        }
        return library;
    }
114966
public Reader create(Reader input, String configuration, String defaultConfiguration) throws IOException {
    if(defaultConfiguration==null) {
      defaultConfiguration = defaultArgument;
    }
    if (configs != null && configs.size() > 0) {
      if (configuration == null && defaultConfiguration == null) {
        throw new IOException("no (default)configuration");
      } else if (configuration == null) {
        if (configs.get(defaultConfiguration) != null) {
          return create(input, configs.get(defaultConfiguration));
        } else {
          throw new IOException(
              "default configuration " + defaultConfiguration + " not available");
        }
      } else {
        MtasConfiguration config = configs.get(configuration);
        if (config == null) {
          if (defaultConfiguration != null) {
            if (configs.get(defaultConfiguration) != null) {
              return create(input, configs.get(defaultConfiguration));
            } else {
              throw new IOException("configuration " + configuration
                  + " not found and default configuration " + defaultConfiguration
                  + " not available");
            }
          } else {
            throw new IOException("configuration " + configuration
                + " not available and no default configuration");
          }
        } else {
          return create(input, config);
        }
      }
    } else if (config != null) {
      return create(input, config);
    } else {
      throw new IOException("no configuration");
    }

  }