ORO, Inc. Logo  All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.oroinc.io.CopyStreamEvent

java.lang.Object
   |
   +----java.util.EventObject
           |
           +----com.oroinc.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.

Copyright © 1997 Original Reusable Objects, Inc. All rights reserved.

See Also:
CopyStreamListener, CopyStreamAdapter, Util

Variable Index

 o UNKNOWN_STREAM_SIZE

Constructor Index

 o CopyStreamEvent(Object, long, int, long)
Creates a new CopyStreamEvent instance.

Method Index

 o getBytesTransferred()
Returns the number of bytes transferred by the write that triggered the event.
 o getStreamSize()
Returns the size of the stream being copied.
 o getTotalBytesTransferred()
Returns the total number of bytes transferred so far by the copy operation.

Variables

 o UNKNOWN_STREAM_SIZE
 public static final long UNKNOWN_STREAM_SIZE

Constructors

 o CopyStreamEvent
 public 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_SIZE if the size is unknown.

Methods

 o getBytesTransferred
 public int getBytesTransferred()
Returns 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.
 o getTotalBytesTransferred
 public long getTotalBytesTransferred()
Returns 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.
 o getStreamSize
 public long getStreamSize()
Returns the size of the stream being copied. This may be set to UNKNOWN_STREAM_SIZE if the size is unknown.

Returns:
The size of the stream being copied.

ORO, Inc. Logo  All Packages  Class Hierarchy  This Package  Previous  Next  Index