/*
(non-Javadoc)

@see java.util.Properties#loadFromXML(java.io.InputStream)
10023
@Override
	public void loadFromXML(final InputStream in) throws IOException {
		lock.writeLock().lock();
		try {
			properties.loadFromXML(in);
		} finally {
			lock.writeLock().unlock();
		}
	}
703055
@Override
    public void initialize(InputStream inputStream, DumpTableEnum table)
			throws IOException {

		unbufferedResult = new PipedInputStream();
		decodedStream = new PipedOutputStream(unbufferedResult);
		result = new BufferedInputStream(unbufferedResult, BUFFERSIZE);

		xmlInputThread = new XMLDumpTableInputStreamThread(inputStream,
				decodedStream, table);
		xmlInputThread.start();

	}
737628
@Override
    public void processXML() throws InjectionException {

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "processXML : " + this);

        List<? extends AdministeredObject> administeredObjectDefinitions = ivNameSpaceConfig.getJNDIEnvironmentRefs(AdministeredObject.class);

        if (administeredObjectDefinitions != null)
        {
            for (AdministeredObject administeredObject : administeredObjectDefinitions)
            {
                String jndiName = administeredObject.getName();
                InjectionBinding<AdministeredObjectDefinition> injectionBinding = ivAllAnnotationsCollection.get(jndiName);
                AdministeredObjectDefinitionInjectionBinding binding;

                if (injectionBinding != null)
                {
                    binding = (AdministeredObjectDefinitionInjectionBinding) injectionBinding;
                }
                else
                {
                    binding = new AdministeredObjectDefinitionInjectionBinding(jndiName, ivNameSpaceConfig);
                    addInjectionBinding(binding);
                }

                binding.mergeXML(administeredObject);
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "processXML : " + this);

    }
788003
private static JCorsConfig loadFromFileStream(InputStream fileStream) {

		try {

			JAXBContext context = JAXBContext.newInstance(ConfigBuilder.class);
			
			Unmarshaller unmarshaller = context.createUnmarshaller();
			unmarshaller.setSchema(loadXmlSchema());

			ConfigBuilder configBuilder = (ConfigBuilder) unmarshaller.unmarshal(fileStream);
			Constraint.ensureNotNull(configBuilder, "It was not possible to get a valid configuration builder instance");

			return configBuilder.buildConfig();

		} catch (Exception e) {

			log.error("Failed loading configuration file", e);
			return null;
		}

	}
882412
public void setXml(String s) {
        assertNotNull(s);
        xml = s;
        setLength(s.length());
    }
415096
private void init(InputStream inputStream) {
        this.inputStream = inputStream;
        currentPath = new LinkedList<Node>();
        nodeQueue = new LinkedList<XmlNode>();
        XMLInputFactory factory = XMLInputFactory.newInstance();
        factory.setProperty("javax.xml.stream.isCoalescing", true);
        factory.setProperty("javax.xml.stream.isReplacingEntityReferences", true);
        try {
            reader = factory.createXMLStreamReader(inputStream);
        } catch (XMLStreamException e) {
            throw new XmlReaderException(e);
        }
    }
939310
public static <T> T readObjectFromXml(String xmlStr) throws IOException {
		return readObjectFromXml(new InputSource(StrUtil.getReader(xmlStr)));
	}
909185
@SuppressWarnings("unchecked")
    public <T> T fromXml(String xml) {
        try {
            StringReader reader = new StringReader(xml);
            return (T) createUnmarshaller().unmarshal(reader);
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
    }
304457
public static XNElement parseXML(File file) throws IOException, XMLStreamException {
        try (InputStream in = new FileInputStream(file)) {
            return parseXML(in);
        }
    }
727730
@Override
    public void onXml(ClientProperties cp)
    {
        hsmd.onInitialize();
        if (cp != null)
        {
            hsmd.setClientProperties(cp);
        }
    }
1203879
public static <T> T readObjectFromXml(File source) throws IOException {
		return readObjectFromXml(new InputSource(FileUtil.getInputStream(source)));
	}
107941
public static Document convertXMLToDOM(String strXML)
    {
        DocumentBuilder db = Util.getDocumentBuilder();
        // Parse the input file
        Document doc = null;
        try {
            synchronized (db)
            {   // db is not thread safe
                doc = db.parse(new InputSource(new StringReader(strXML)));
            }
        } catch (SAXException se) {
            System.out.println(se.getMessage());
            return null;
        } catch (IOException ioe) {
            System.out.println(ioe);
            return null;
        } catch (Exception ioe) {
            System.out.println(ioe);
            return null;
        }
        return doc;
    }
406807
public static XElement parseXML(File file) throws XMLStreamException {
        try (InputStream in = new FileInputStream(file)) {
            return parseXML(in);
        } catch (IOException ex) {
            throw new XMLStreamException(ex);
        }
    }
641806
public static DeploymentDescriptor fromXml(InputStream inputStream) {
        try {
            Unmarshaller unmarshaller = getContext().createUnmarshaller();
            unmarshaller.setSchema(schema);
            DeploymentDescriptor descriptor = (DeploymentDescriptor) unmarshaller.unmarshal(inputStream);

            return descriptor;
        } catch (Exception e) {
            throw new RuntimeException("Unable to read deployment descriptor from xml", e);
        }
    }
1171296
public final LinkedProperties
    loadPropertiesXml(final String pFileName)
        throws Exception {
    LinkedProperties props = null;
    URL urlSettingXml = UtlProperties.class
      .getResource(pFileName);
    if (urlSettingXml != null) {
      props = new LinkedProperties();
      InputStream inputStream = null;
      try {
        inputStream = UtlProperties.class.getResourceAsStream(pFileName);
        props.loadFromXML(inputStream);
      } finally {
        if (inputStream != null) {
          inputStream.close();
        }
      }
    }
    return props;
  }
567961
@Override
    public InputStream GetObjectXML() throws ObjectIntegrityException,
                                             StreamIOException, UnsupportedTranslationException, ServerException {
        ReadableByteArrayOutputStream bytes = new ReadableByteArrayOutputStream(4096);
        m_translator.serialize(m_obj,
                               bytes,
                               m_storageFormat,
                               "UTF-8",
                               DOTranslationUtility.SERIALIZE_STORAGE_INTERNAL);
        return bytes.toInputStream();
    }
994589
public static Inputs load(InputStream in) throws JAXBException {
        JAXBContext context = JAXBContext.newInstance(Inputs.class, RF2Input.class, OWLInput.class);
        Unmarshaller u = context.createUnmarshaller();
        Inputs inputs = (Inputs) u.unmarshal(in);
        return inputs;
    }