Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.net.io
Class CopyStreamEvent

    java.lang.Object
      |
      +--java.util.EventObject
            |
            +--org.apache.commons.net.io.CopyStreamEvent

All Implemented Interfaces:
  java.io.Serializable

public class CopyStreamEvent
extends java.util.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.

Version:
  $Id: CopyStreamEvent.java,v 1.6 2003/01/26 04:33:32 brekke Exp $
Author:
  Daniel F. Savarese
See Also:
  `CopyStreamListener`, `CopyStreamAdapter`, `Util`, Serialized Form

Field Summary
`static long` | `UNKNOWN_STREAM_SIZE` Constant used to indicate the stream size is unknown.

Fields inherited from class java.util.EventObject
`source`

Constructor Summary
`CopyStreamEvent(java.lang.Object source, long totalBytesTransferred, int bytesTransferred, long streamSize)` Creates a new CopyStreamEvent instance.

Method Summary
`int` | `getBytesTransferred()` Returns the number of bytes transferred by the write that triggered the event.
`long` | `getStreamSize()` Returns the size of the stream being copied.
`long` | `getTotalBytesTransferred()` Returns the total number of bytes transferred so far by the copy operation.

Methods inherited from class java.util.EventObject
`getSource, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### UNKNOWN_STREAM_SIZE

    public static final long UNKNOWN_STREAM_SIZE

  Constant used to indicate the stream size is unknown.

  See Also:
    Constant Field Values

Constructor Detail

### CopyStreamEvent

    public CopyStreamEvent(java.lang.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.

Method Detail

### 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.

### 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.

### 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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1997-2003 Apache Software Foundation. All Rights Reserved.