Closes an {@link XMLStreamReader}.

<p>
This method will quietly log any {@link IOException} that may occur but will otherwise ignore
it.
</p>

@param reader
XMLStreamReader to be closed.
547931
public static void closeQuietly(final XMLStreamReader reader) {
        try {
            if (reader != null) {
                reader.close();
            }
        } catch (final Throwable t) {
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Ignoring exception that occurred when closing XMLStreamReader", t);
            }
        }
    }
967247
@Override
  public void parseXml(Reader reader) throws IOException, XmlPullParserException {
    XmlNamespaceDictionary namespaceDictionary = new XmlNamespaceDictionary();
    namespaceDictionary.set("", "");
    super.parseXml(reader, namespaceDictionary);
  }
406343
public static String readFully(Reader reader) throws IOException {
        try {
            StringWriter writer = new StringWriter();
            char[] buffer = new char[1024];
            int count;
            while ((count = reader.read(buffer)) != -1) {
                writer.write(buffer, 0, count);
            }
            return writer.toString();
        } finally {
            reader.close();
        }
    }
279697
public void close() throws IOException {
		if(inner instanceof CloseableIterator) {
			CloseableIterator<String> toBeClosed = (CloseableIterator<String>) inner;
			toBeClosed.close();
		}
	}
106183
public void close() throws IOException {
		this.accessors.clear();
		if (this.reader != null) {
			this.reader.close();
			this.reader = null;
		}
	}
129964
public void close()
        throws IOException
    {        
        // Are we already closed?
        if (_out==null)
            return;
        _closing=true;
        // Close
        try {
            notify(OutputObserver.__CLOSING);

            OutputStream out =_out;
            _out=null;
            
            if (out!=_bufferedOut)
                out.close();
            else
                _bufferedOut.close();
            
            notify(OutputObserver.__CLOSED);
        }
        catch (IOException e)
        {
            LogSupport.ignore(log,e);
        }
    }
77104
public static ReadStreamOld openRead(Reader reader)
  {
    if (reader instanceof ReadStreamOld.StreamReader)
      return ((ReadStreamOld.StreamReader) reader).getStream();
    
    ReaderWriterStream s = new ReaderWriterStream(reader, null);
    ReadStreamOld is = new ReadStreamOld(s);
    try {
      is.setEncoding("utf-8");
    } catch (Exception e) {
    }

    return is;
  }
1095235
@Override
    public void close() throws IOException {
        if (!closed) {
            closed = true;
            nodeCursor = null;
            _currToken = null;
        }
    }
543170
private void destroy(Process p, BufferedReader reader){
		p.destroy();
		try {
			reader.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
781029
public void parse (Reader reader) {
		try {
			char[] data = new char[1024];
			int offset = 0;
			while (true) {
				int length = reader.read(data, offset, data.length - offset);
				if (length == -1) break;
				if (length == 0) {
					char[] newData = new char[data.length * 2];
					System.arraycopy(data, 0, newData, 0, data.length);
					data = newData;
				} else
					offset += length;
			}
			parse(data, 0, offset);
		} catch (IOException ex) {
			throw new SerializationException(ex);
		} finally {
			StreamUtils.closeQuietly(reader);
		}
	}
657913
public void parseXml(Reader reader) throws IOException, XmlPullParserException {
    this.xmlPullParser.setInput(reader);
    Xml.parseElement(this.xmlPullParser, this, this.defaultNamespaceDictionary, null);
  }
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();
    }
627841
public void close() {
        // getting a read lock will ensure all writes have finished
        // if we are really closing assume that we don't care about reads
        readLock.lock();
        try {
            if (container != null) {
                try {
                    container.close();
                    container = null;
                    log.info("Closed container");
                } catch (XmlException e) {
                    log.warn("close failed: " + e.getMessage(), e);
                }
            }

            if (manager != null) {
                try {
                    manager.close();
                    manager = null;
                    log.info("Closed manager");
                } catch (XmlException e) {
                    log.warn("close failed: " + e.getMessage(), e);
                }
            }
        } finally {
            readLock.unlock();
        }
    }
1337511
@Override
    public synchronized void shutdown() throws JournalException {
        try {
            if (open) {
                reader.close();
                open = false;
            }
        } catch (XMLStreamException e) {
            throw new JournalException(e);
        }
    }
754209
@Override
    public XMLStreamReader createXMLStreamReader(InputStream in)
        throws XMLStreamException
    {
        // false for auto-close, since caller has access to the input stream
        return createSR(null, in, null, false, false);
    }
806139
@Override
	public void close() throws IOException {
		if (curr != null) {
			curr.close();
		}
		Reader reader;
		while ((reader = getNextInputReader()) != null) {
			reader.close();
		}
		closed = true;
	}
1110815
@Override
  public synchronized void close() throws Exception {
    if (this.readerWriter != null && !this.writerClosed) {
      this.readerWriter.close();
      this.writerClosed = true;
    }
  }