|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeer2me.message.FileObject
peer2me.message.ReceivedFileObject
public class ReceivedFileObject
This class extends FileObject
and implements Runnable
and is used by the
Message
class. When the framework receives a file or parts of
a file from the network, an instance of this class is created and added to the Message in a
MessagePart
. Bytes are then constantly written to a FileOutPutStream in this class
when new parts of the file is received.
An instance of this class should only be created by the framework itself.
Constructor Summary | |
---|---|
ReceivedFileObject(java.lang.String fileName,
long fileSize)
Constructor that starts a thread when called. |
Method Summary | |
---|---|
void |
finishedWriting()
When there are no more bytes to write, this method closes the streams used. |
void |
run()
Creates a directory to store the file in if the directory does not exists. |
void |
setFileName(java.lang.String fileName)
Sets the name of the file assosiated with this class |
void |
write(byte[] bytes)
Appends a number of bytes to the file assosiated with this class |
Methods inherited from class peer2me.message.FileObject |
---|
getFileName, getFileSize, getFullPathToFile, isAccessGranted |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReceivedFileObject(java.lang.String fileName, long fileSize)
fileName
- The name of the file that is createdfileSize
- The total size of the file that is createdMethod Detail |
---|
public void run()
tmpp2me
and is created in one of the root directories of the mobile phone.
run
in interface java.lang.Runnable
public void write(byte[] bytes)
bytes
- The bytes that are appended to the filepublic void finishedWriting()
public void setFileName(java.lang.String fileName)
fileName
- The name of the file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |