Package com.emc.esu.api

Examples of com.emc.esu.api.Extent


                // done
                complete();
                return;
            }

            Extent extent = new Extent(currentBytes, buffer.getSize());
            esu.updateObjectFromSegment(id, null, null, extent, buffer, null, checksum);
            this.progress(buffer.getSize());
        }

    }
View Full Code Here


        }

        // Loop, downloading chunks until the transfer is complete.
        while (true) {
            try {
                Extent extent = null;

                // Determine how much data to download.  If we're at the last
                // request in the transfer, only request as many bytes as needed
                // to get to the end of the file.
                if (currentBytes + buffer.getBuffer().length > totalBytes) {
                    // Would go past end of file.  Request less bytes.                                     
                    extent = new Extent(this.currentBytes, totalBytes
                            - currentBytes);
                } else {
                    extent = new Extent(this.currentBytes,
                            buffer.getBuffer().length);
                }
                buffer.setSize((int) extent.getSize());

                // Read data from the server.
                byte[] obuffer = this.esu.readObject(id, extent, buffer.getBuffer(), checksum);

                // See if they returned the buffer we're using.  In some
                // cases, this doesn't happen (when content length is not
                // defined in the response).
                if( obuffer != buffer.getBuffer() ) {
                    if( obuffer.length != extent.getSize() ) {
                        throw new EsuException( "Read size mismatch.  " +
                            "Requested " + extent.getSize() +
                            " bytes but received " +
                            obuffer.length + " bytes" );
                    }
                    stream.write( obuffer, 0, obuffer.length );
                } else {
View Full Code Here

TOP

Related Classes of com.emc.esu.api.Extent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.