de.hfu.anybeam.networkCore

## Interface DataReceiverAdapter

- All Superinterfaces:
    AbstractTransmissionAdapter

      public interface DataReceiverAdapter
      extends AbstractTransmissionAdapter

  An adapter interface to control a `DataReceiver` an its `DataReceiverConnection`s.
  Since:
    1.0
  Version:
    1.0
  Author:
    chrwuer

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeOutputStream(TransmissionEvent e, java.io.OutputStream out)` Called after the transmission is done.
    `java.io.OutputStream` | `downloadStarted(TransmissionEvent e, java.lang.String clientId)` Called before the transmission starts.

    - ### Methods inherited from interface de.hfu.anybeam.networkCore.AbstractTransmissionAdapter

      `transmissionDone, transmissionFailed, transmissionProgressChanged, transmissionStarted`

- - ### Method Detail

    - #### downloadStarted

          java.io.OutputStream downloadStarted(TransmissionEvent e,
                                             java.lang.String clientId)

      Called before the transmission starts.
      Parameters:
        `e` - the `TransmissionEvent` describing the `DataReceiverConnection`'s state
        `clientId` - the client id of the sender or null if no id is available
      Returns:
        the `OutputStream` to which the received data will be written

    - #### closeOutputStream

          void closeOutputStream(TransmissionEvent e,
                               java.io.OutputStream out)

      Called after the transmission is done. You may close the given `OutputStream` which was originally created in `downloadStarted(TransmissionEvent, String)`, or leave it open for further operations.
      Parameters:
        `e` - the `TransmissionEvent` describing the `DataReceiverConnection`'s state
        `out` - the `OutputStream` in which the received data was written (created in `downloadStarted(TransmissionEvent, String)`