All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qcloud.cos.event.RequestProgressInputStream Maven / Gradle / Ivy

There is a newer version: 5.6.238.2
Show newest version
package com.qcloud.cos.event;

import java.io.InputStream;

import static com.qcloud.cos.event.SDKProgressPublisher.publishRequestBytesTransferred;
import static com.qcloud.cos.event.SDKProgressPublisher.publishRequestReset;

/**
 * Used for request input stream progress tracking purposes.
 */
class RequestProgressInputStream extends ProgressInputStream {

    RequestProgressInputStream(InputStream is, ProgressListener listener) {
        super(is, listener);
    }

    @Override
    protected void onReset() {
        publishRequestReset(getListener(), getNotifiedByteCount());
    }

    @Override
    protected void onEOF() {
        onNotifyBytesRead();
    }

    @Override
    protected void onNotifyBytesRead() {
        publishRequestBytesTransferred(getListener(), getUnnotifiedByteCount());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy