|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--FileSender
Constructor Summary | |
FileSender(java.lang.String file)
Obtains the name of the file to be sent across to the client. |
Method Summary | |
byte[] |
readFile(java.lang.String name)
Reads in the data from the file specifited by String name into a byte array and returns it. |
void |
runServer()
Initializes the server. |
void |
sendFile(java.io.DataOutputStream ops,
byte[] buf)
Sends the data contained in the byte array through the DataOutputStream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileSender(java.lang.String file)
file
- a string indicating the name of the file to be sent.Method Detail |
public void runServer()
public byte[] readFile(java.lang.String name) throws java.io.IOException
name
- the name of the file to be read
java.io.IOException
public void sendFile(java.io.DataOutputStream ops, byte[] buf) throws java.io.IOException
ops
- the DataOutputStream
buf[] the byte array to send
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |