Warning : the input stream is closed in this method
439864
public List<Rule> parse(InputStream input) {
    try (Reader reader = new InputStreamReader(input, UTF_8)) {
      return parse(reader);

    } catch (IOException e) {
      throw new SonarException("Fail to load the xml stream", e);
    }
  }
1342844
@Override
    public void close() throws IOException
    {
        InputStream in = mIn;

        if (in != null) {
            mIn = null;
            freeBuffers();
            in.close();
        }
    }
46080
private void streamToOutput(InputStream inputStream) throws IOException {
    try {
      byte[] buffer = new byte[4096];
      int bytesRead = -1;
      while ((bytesRead = inputStream.read(buffer)) != -1) {
        outputStream.write(buffer, 0, bytesRead);
      }
      outputStream.flush();
    } finally {
      inputStream.close();
    }
  }
1007705
byte[] readAndClose(InputStream input) throws IOException {
        byte[] buffer = new byte[512];
        ByteArrayOutputStream out = new ByteArrayOutputStream(buffer.length);
        int read;
        try {
            read = input.read(buffer); //assignment separate from loop invariant check for code coverage checks
            while (read != -1) {
                out.write(buffer, 0, read);
                read = input.read(buffer);
            }
        } finally {
            Objects.nullSafeClose(input);
        }
        return out.toByteArray();
    }
1089786
public static void safelyClose(OutputStream stream) {
		if(stream != null) {
			try {
				stream.close();
			} catch(IOException e) {
				logger.warn("error closing internal output stream, this may lead to a stream leak", e);
			}
		}
	}
381163
@Override
    public final void close() {
        if (this.inputStream != null) {
            try {
                this.inputStream.close();
            } catch (IOException ioe) {
                logger.error("Unable to close output stream.", ioe);
            } finally {
                this.inputStream = null;
            }
        }

        dispose();
    }
236381
public final void close() {
        if (m_stream==null) {
            return;
        }
        try {
            m_stream.close();
        }
        catch (IOException e) {
        }
        if (m_nextException==null) {
            m_nextException=new IOException("Closed.");
        }
        m_stream=null;
        resetState();
    }
283540
public static void close (OutputStream out)
    {
        if (out != null) {
            try {
                out.close();
            } catch (IOException ioe) {
                log.warning("Error closing output stream", "stream", out, "cause", ioe);
            }
        }
    }
813659
protected void validate() throws IOException {
        if (null != this.error) {
            throw this.error;
        }
        if (isClosed()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "validate - is closed: hc: " + this.hashCode() + " details: " + this);
            }

            throw new IOException("Stream is closed");
        }
        if (null == this.output) {
            setBufferSize(32768);
        }
    }
1233519
public void close() throws java.io.IOException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){  
            Tr.debug(tc, "close output");         
        }

        if(this._listener!= null && this.isOutputStreamNBClosed()){
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){  
                Tr.debug(tc, "output stream close previously completed ...return ");
            }
            return;
        }

        try{
            this._httpOut.setAsyncServletWriteListenerCallBack(null);    
            super.close();
        }
        finally {
            if(this._listener!= null)
                this.setOutputStreamNBClosed(true);
        }
    }
768397
def close_stream(self):
        
        if self.fout:
            fout = self.fout
            fout_fn = self.fout_fn
            self.fout.flush()
            self.fout.close()
            self.fout = None
            self.fout_fn = None
            return fout_fn
869509
@Override
    public void close() throws IOException {
        // If not already closed, then close the input stream.
        if(!this.closed) {
            this.closed = true;
            // if the user read to the end of the virtual stream, then drain
            // the wrapped stream so the HTTP client can keep this connection
            // alive if possible.
            // This should not have too much overhead since if we've reached the
            // end of the virtual stream, there should be at most 31 bytes left
            // (2 * JceEncryptionConstants.SYMMETRIC_CIPHER_BLOCK_SIZE - 1) in the
            // stream.
            // See: S3CryptoModuleBase#getCipherBlockUpperBound
             if (this.virtualAvailable == 0) {
                 IOUtils.drainInputStream(decryptedContents);
            }
            this.decryptedContents.close();
        }
        abortIfNeeded();
    }
207672
public void close() throws IOException {
		if (thread.isAlive()) {
			thread.closed = true;
			thread.interrupt();
		}

		if (stream != null) {
			stream.close();
		}
	}
863628
public void close()
        throws IOException
    {
        InputStream is = _is;
        _is = null;

        if (is != null)
            is.close();

        _state.println();
    }
692063
public void close() throws IOException {
        if (dataStream != null) dataStream.close();
        byteStream = null;
        dataStream = null;
    }
127139
@Override
	public void close() throws IOException {
		if (resultSet == null) {
			return;
		}
		try {
			resultSet.close();
		} catch (SQLException se) {
			LOG.info("Inputformat ResultSet couldn't be closed - " + se.getMessage());
		}
	}
97466
@Override
    public synchronized void close() {
        if (currentStatus != StreamStatus.CLOSED) {
            // Only flush the print stream: don't close it.
            currentPrintStream.flush();

            if (!LoggingFileUtils.tryToClose(currentPrintStream)) {
                LoggingFileUtils.tryToClose(currentFileStream);
            }

            // Send to bit bucket again-- this holder is done (false -- do not replace)
            setStreamStatus(StreamStatus.CLOSED, null, null, DummyOutputStream.psInstance);
        }
    }