library/src/main/java/com/kdgregory/aws/utils/s3/S3OutputStream.java
/**
     *  Closes the stream, writing the last segment and completing the upload.
     *  No-op if the stream has been aborted.
     */
Closes the stream, writing the last segment and completing the upload.
No-op if the stream has been aborted.
Closes the stream writing the last segment and completing the upload . No - op if the stream has been aborted .
@Override
    public void close()
    throws IOException
    {
        if (buffer == null)
            return;
        if (upload == null)
        {
            logger.debug("buffer size is " + buffer.size() + "; using PutObject");
            int uploadSize = buffer.size();
            ByteArrayInputStream uploadChunk = new ByteArrayInputStream(buffer.get(), 0, uploadSize);
            metadata.setContentLength(uploadSize);
            client.putObject(bucket, key, uploadChunk, metadata);
        }
        else
        {
            writePart(true);
            upload.complete();
        }
        buffer = null;
    }
@ Override public void close ( ) throws IOException { if ( buffer == null ) return ; if ( upload == null ) { logger . debug ( "buffer size is " + buffer . size ( ) + "; using PutObject" ) ; int uploadSize = buffer . size ( ) ; ByteArrayInputStream uploadChunk = new ByteArrayInputStream ( buffer . get ( ) , 0 , uploadSize ) ; metadata . setContentLength ( uploadSize ) ; client . putObject ( bucket , key , uploadChunk , metadata ) ; } else { writePart ( true ) ; upload . complete ( ) ; } buffer = null ; }
Closes the stream, writing the last segment and completing the upload.
Closes the stream writing the last segment and completing the upload .