Ejemplo n.º 1
0
  public void close() throws IOException {
    for (int i = 1; i < databuffer.length; i++) {
      super.write(databuffer[i]);
    }

    super.flush();
    super.close();
  }
Ejemplo n.º 2
0
    /**
     * Flushes and closes (I think, in the superclass) the stream.
     *
     * @since 1.3
     */
    public void close() throws java.io.IOException {
      // 1. Ensure that pending characters are written
      flushBase64();

      // 2. Actually close the stream
      // Base class both flushes and closes.
      super.close();

      buffer = null;
      out = null;
    } // end close
 /**
  * End the current part.
  *
  * @exception IOException IOException
  */
 @Override
 public void close() throws IOException {
   try {
     if (inPart) out.write(__CRLF);
     out.write(__DASHDASH);
     out.write(boundaryBytes);
     out.write(__DASHDASH);
     out.write(__CRLF);
     inPart = false;
   } finally {
     super.close();
   }
 }
Ejemplo n.º 4
0
 /**
  * Closes the stream, this MUST be called to ensure proper padding is written to the end of the
  * output stream.
  *
  * @exception IOException if an I/O error occurs
  */
 public void close() throws IOException {
   // Handle leftover bytes
   if (charCount % 3 == 1) { // one leftover
     int lookup = (carryOver << 4) & 63;
     out.write(chars[lookup]);
     out.write('=');
     out.write('=');
   } else if (charCount % 3 == 2) { // two leftovers
     int lookup = (carryOver << 2) & 63;
     out.write(chars[lookup]);
     out.write('=');
   }
   super.close();
 }
Ejemplo n.º 5
0
    @Override
    public void close() throws IOException {
      if (closed) {
        return;
      }
      closed = true;

      try {
        super.close();
        uploadObject();
      } finally {
        if (!tempFile.delete()) {
          log.warn("Could not delete temporary file: %s", tempFile);
        }
        // close transfer manager but keep underlying S3 client open
        transferManager.shutdownNow(false);
      }
    }
Ejemplo n.º 6
0
  /**
   * Closes this output stream and releases any system resources associated with this stream.
   *
   * <p>This method invokes the <code>doFinal</code> method of the encapsulated cipher object, which
   * causes any bytes buffered by the encapsulated cipher to be processed. The result is written out
   * by calling the <code>flush</code> method of this output stream.
   *
   * <p>This method resets the encapsulated cipher object to its initial state and calls the <code>
   * close</code> method of the underlying output stream.
   *
   * @exception java.io.IOException if an I/O error occurs.
   */
  public void close() throws IOException {
    try {
      if (bufferedBlockCipher != null) {
        byte[] buf = new byte[bufferedBlockCipher.getOutputSize(0)];

        int outLen = bufferedBlockCipher.doFinal(buf, 0);

        if (outLen != 0) {
          out.write(buf, 0, outLen);
        }
      }
    } catch (Exception e) {
      throw new IOException("Error closing stream: " + e.toString());
    }

    flush();

    super.close();
  }
Ejemplo n.º 7
0
 @Override
 public void close() throws IOException {
   super.close();
   out2.close();
 }
Ejemplo n.º 8
0
 /* (non-Javadoc)
  * @see java.io.FilterOutputStream#close()
  */
 @Override
 public void close() throws IOException {
   System.out.println();
   System.out.flush();
   super.close();
 }
 public void close() {
   super.close();
   __socket.close();
 }
Ejemplo n.º 10
0
 @Override
 public void close() throws IOException {
   if (this.blockPos > 0) this.writeInfo();
   super.flush();
   super.close();
 }
Ejemplo n.º 11
0
 /**
  * * Closes the stream and immediately afterward closes the referenced socket.
  *
  * <p>
  *
  * @exception IOException If there is an error in closing the stream or socket. *
  */
 @Override
 public void close() throws IOException {
   super.close();
   __socket.close();
 }
Ejemplo n.º 12
0
 @Override
 public void close() throws IOException {
   out.write(HTML[3]);
   super.close();
 }
Ejemplo n.º 13
0
 @Override
 public void close() throws IOException {
   is.close();
   super.close();
 }
 @Override
 public void close() throws IOException {
   super.close();
   outputStreamClosed = true;
 }
 @Override
 public void close() throws IOException {
   super.close();
   openOutputStreams.remove(this);
 }