Package org.apache.commons.net.io
Class CopyStreamEvent
java.lang.Object
java.util.EventObject
org.apache.commons.net.io.CopyStreamEvent
- All Implemented Interfaces:
- Serializable
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 Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final longConstant used to indicate the stream size is unknown.Fields inherited from class java.util.EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionCopyStreamEvent(Object source, long totalBytesTransferred, int bytesTransferred, long streamSize) Creates a new CopyStreamEvent instance.
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the number of bytes transferred by the write that triggered the event.longReturns the size of the stream being copied.longReturns the total number of bytes transferred so far by the copy operation.toString()Methods inherited from class java.util.EventObjectgetSource
- 
Field Details- 
UNKNOWN_STREAM_SIZEConstant used to indicate the stream size is unknown.- See Also:
 
 
- 
- 
Constructor Details- 
CopyStreamEventpublic CopyStreamEvent(Object source, long totalBytesTransferred, int bytesTransferred, long streamSize) Creates a new CopyStreamEvent instance.- Parameters:
- source- The source of the event.
- totalBytesTransferred- The total number of bytes transferred so far during a copy operation.
- bytesTransferred- The number of bytes transferred during the write that triggered the CopyStreamEvent.
- streamSize- The number of bytes in the stream being copied. This may be set to- UNKNOWN_STREAM_SIZEif the size is unknown.
 
 
- 
- 
Method Details- 
getBytesTransferredReturns the number of bytes transferred by the write that triggered the event.- Returns:
- The number of bytes transferred by the write that triggered the vent.
 
- 
getStreamSizeReturns the size of the stream being copied. This may be set toUNKNOWN_STREAM_SIZEif the size is unknown.- Returns:
- The size of the stream being copied.
 
- 
getTotalBytesTransferredReturns the total number of bytes transferred so far by the copy operation.- Returns:
- The total number of bytes transferred so far by the copy operation.
 
- 
toString- Overrides:
- toStringin class- EventObject
- Since:
- 3.0
 
 
-