javax.usb.event
Class UsbPipeDataEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byjavax.usb.event.UsbPipeEvent
          extended byjavax.usb.event.UsbPipeDataEvent
All Implemented Interfaces:
java.io.Serializable

public class UsbPipeDataEvent
extends UsbPipeEvent

Indicates data was successfully transferred over the UsbPipe.

This event will be fired to all listeners for all data that is transferred over the pipe.

Author:
Dan Streetman, E. Michael Maximilien
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
UsbPipeDataEvent(UsbPipe source, byte[] d, int aL)
          Constructor.
UsbPipeDataEvent(UsbPipe source, UsbIrp uI)
          Constructor.
 
Method Summary
 int getActualLength()
          Get the actual length.
 byte[] getData()
          Get the data.
 
Methods inherited from class javax.usb.event.UsbPipeEvent
getUsbIrp, getUsbPipe, hasUsbIrp
 
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
 

Constructor Detail

UsbPipeDataEvent

public UsbPipeDataEvent(UsbPipe source,
                        byte[] d,
                        int aL)
Constructor.

This should only be used if there is no UsbIrp associated with this event.

Parameters:
source - The UsbPipe.
d - The data.
aL - The actual length of data transferred.

UsbPipeDataEvent

public UsbPipeDataEvent(UsbPipe source,
                        UsbIrp uI)
Constructor.

Parameters:
source - The UsbPipe.
uI - The UsbIrp.
Method Detail

getData

public byte[] getData()
Get the data.

If there is an associated UsbIrp, this returns a new byte[] containing only the actual transferred data. If there is no associated UsbIrp, this returns the actual data buffer used.

Returns:
The transferred data.

getActualLength

public int getActualLength()
Get the actual length.

Returns:
The actual amount of transferred data.