public class DataSender extends AbstractTransmission
DataReceiver.| Constructor and Description |
|---|
DataSender(java.io.InputStream inputStream,
long inputStreamLength,
java.lang.String inputName,
EncryptionType encryptionType,
byte[] encryptionKey,
int receiverPort,
java.net.InetAddress receiverAddress)
Creates a new
DataSender instance. |
DataSender(java.io.InputStream inputStream,
long inputStreamLength,
java.lang.String inputName,
EncryptionType encryptionType,
byte[] encryptionKey,
int receiverPort,
java.net.InetAddress receiverAddress,
AbstractTransmissionAdapter adapter)
Creates a new
DataSender instance. |
DataSender(java.io.InputStream inputStream,
long inputStreamLength,
java.lang.String inputName,
EncryptionType encryptionType,
byte[] encryptionKey,
int receiverPort,
java.net.InetAddress receiverAddress,
AbstractTransmissionAdapter adapter,
java.lang.String senderClientId)
Creates a new
DataSender instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
forceCloseTransmissionStream()
Closes all closable resources used by this
AbstractTransmission. |
void |
transmit()
Transmits the data.
|
cancelTransmission, getAveragSpeed, getResourceName, getTotalLength, getTransmissionId, getTransmittedLength, isCanceled, isDone, run, startTransmissionactiveCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic DataSender(java.io.InputStream inputStream,
long inputStreamLength,
java.lang.String inputName,
EncryptionType encryptionType,
byte[] encryptionKey,
int receiverPort,
java.net.InetAddress receiverAddress)
DataSender instance.inputStream - the InputStream to sendinputStreamLength - the length of inputStream or -1 if the stream is endlessinputName - the name of the resource represented by inputStream, e.g. the filenameencryptionType - the EncryptionType that will be usedencryptionKey - the encryption key that will be usedreceiverPort - the port on which the receiver is waitingreceiverAddress - the InetAddress of the receiverpublic DataSender(java.io.InputStream inputStream,
long inputStreamLength,
java.lang.String inputName,
EncryptionType encryptionType,
byte[] encryptionKey,
int receiverPort,
java.net.InetAddress receiverAddress,
AbstractTransmissionAdapter adapter)
DataSender instance.inputStream - the InputStream to sendinputStreamLength - the length of inputStream or -1 if the stream is endlessinputName - the name of the resource represented by inputStream, e.g. the filenameencryptionType - the EncryptionType that will be usedencryptionKey - the encryption key that will be usedreceiverPort - the port on which the receiver is waitingreceiverAddress - the InetAddress of the receiveradapter - the AbstractTransmissionAdapter to be notified about progress updatespublic DataSender(java.io.InputStream inputStream,
long inputStreamLength,
java.lang.String inputName,
EncryptionType encryptionType,
byte[] encryptionKey,
int receiverPort,
java.net.InetAddress receiverAddress,
AbstractTransmissionAdapter adapter,
java.lang.String senderClientId)
DataSender instance.inputStream - the InputStream to sendinputStreamLength - the length of inputStream or -1 if the stream is endlessinputName - the name of the resource represented by inputStream, e.g. the filenameencryptionType - the EncryptionType that will be usedencryptionKey - the encryption key that will be usedreceiverPort - the port on which the receiver is waitingreceiverAddress - the InetAddress of the receiveradapter - the AbstractTransmissionAdapter to be notified about progress updatessenderClientId - this device's client id to send to the receiver to identify this devicepublic void transmit()
throws java.lang.Exception
AbstractTransmissionAbstractTransmission.increaseTransmittedLength(long) in fixed periods to allow precise speed and progress measurements.java.lang.Exceptionpublic void forceCloseTransmissionStream()
throws java.io.IOException
AbstractTransmissionAbstractTransmission. Is calles after a transmission is successfully done or in case of an error.java.io.IOException