rero.dcc

Class Send

public class Send extends ProtocolDCC

Field Summary
protected longackSize
protected FiledumpFrom
protected FileInputStreamfileStream
protected longfinalSize
protected static intPACKET_SIZE
protected longsentSize
protected longstartSize
Constructor Summary
Send(String _nickname, File _dumpFrom)
Create a ready to rock and roll receive socket.
Method Summary
voidfireError(String description)
voidfireEvent(String event, String description)
longgetAcknowledgedSize()
return the total number of bytes that have been acknowledged by the user
longgetBytesSent()
return the total number of bytes that have been sent
FilegetFile()
return the File we are sending to the user
longgetStartOffset()
return the number of bytes that we started out with (0 normally, however in the case of a resume this number could be anything from 0 up to nearly the size of the file
longgetTimeRemaining()
return the estimated time remaning in seconds
intgetTransferRate()
return the number of bytes transferred per second
intgetTypeOfDCC()
booleanresume(long size)
voidrun()

Field Detail

ackSize

protected long ackSize

dumpFrom

protected File dumpFrom

fileStream

protected FileInputStream fileStream

finalSize

protected long finalSize

PACKET_SIZE

protected static int PACKET_SIZE

sentSize

protected long sentSize

startSize

protected long startSize

Constructor Detail

Send

public Send(String _nickname, File _dumpFrom)
Create a ready to rock and roll receive socket. It is assumed that the File object is either cleared or ready to be resumed. An overwrite command should delete the file first and then start dumping to it. Hopefully this is a safe way to go. Eh?

Method Detail

fireError

public void fireError(String description)

fireEvent

public void fireEvent(String event, String description)

getAcknowledgedSize

public long getAcknowledgedSize()
return the total number of bytes that have been acknowledged by the user

getBytesSent

public long getBytesSent()
return the total number of bytes that have been sent

getFile

public File getFile()
return the File we are sending to the user

getStartOffset

public long getStartOffset()
return the number of bytes that we started out with (0 normally, however in the case of a resume this number could be anything from 0 up to nearly the size of the file

getTimeRemaining

public long getTimeRemaining()
return the estimated time remaning in seconds

getTransferRate

public int getTransferRate()
return the number of bytes transferred per second

getTypeOfDCC

public int getTypeOfDCC()

resume

public boolean resume(long size)

run

public void run()