FileDocCategorySizeDatePackage
CopyStreamEvent.javaAPI DocApache Commons NET 1.4.1 API3190Sat Dec 03 10:05:48 GMT 2005org.apache.commons.net.io

CopyStreamEvent

public class CopyStreamEvent extends EventObject
A CopyStreamEvent is triggered after every write performed by a stream copying operation. The event stores the number of bytes transferred by the write triggering the event as well as the total number of bytes transferred so far by the copy operation.

see
CopyStreamListener
see
CopyStreamAdapter
see
Util
author
Daniel F. Savarese
version
$Id: CopyStreamEvent.java 165675 2005-05-02 20:09:55Z rwinston $

Fields Summary
public static final long
UNKNOWN_STREAM_SIZE
Constant used to indicate the stream size is unknown.
private int
bytesTransferred
private long
totalBytesTransferred
private long
streamSize
Constructors Summary
public CopyStreamEvent(Object source, long totalBytesTransferred, int bytesTransferred, long streamSize)
Creates a new CopyStreamEvent instance.

param
source The source of the event.
param
totalBytesTransferred The total number of bytes transferred so far during a copy operation.
param
bytesTransferred The number of bytes transferred during the write that triggered the CopyStreamEvent.
param
streamSize The number of bytes in the stream being copied. This may be set to UNKNOWN_STREAM_SIZE if the size is unknown.


                                                                                                     
        
                              
    
        super(source);
        this.bytesTransferred = bytesTransferred;
        this.totalBytesTransferred = totalBytesTransferred;
        this.streamSize = streamSize;
    
Methods Summary
public intgetBytesTransferred()
Returns the number of bytes transferred by the write that triggered the event.

return
The number of bytes transferred by the write that triggered the vent.

        return bytesTransferred;
    
public longgetStreamSize()
Returns the size of the stream being copied. This may be set to UNKNOWN_STREAM_SIZE if the size is unknown.

return
The size of the stream being copied.

        return streamSize;
    
public longgetTotalBytesTransferred()
Returns the total number of bytes transferred so far by the copy operation.

return
The total number of bytes transferred so far by the copy operation.

        return totalBytesTransferred;