|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeer2me.domain.DataPackage
peer2me.domain.FilePackage
This class represents a data package containing metadata about a file of some sort that should be sent over the network. The package contains the file path and length of the file to transfer, so that the receiver can handle the incoming stream of data and transform it back into a copy of the file.
Field Summary |
Fields inherited from class peer2me.domain.DataPackage |
FILE_PACKAGE, GROUP_SYNC_PACKAGE, log, TEXT_PACKAGE |
Constructor Summary | |
FilePackage()
Constructor used to create an empty FilePackage object to fill with the parseBytes() method |
|
FilePackage(Node sender,
java.lang.String[] recipients,
java.lang.String filePath)
Constructor |
Method Summary | |
java.lang.String |
getFilePath()
This method returns the file path of this FilePackage |
long |
getFileSize()
This method returns the file size of this FilePackage |
void |
parseBytes(byte[] data)
This method parses the content of the byte array (byte[]) back into a FilePackage object |
byte[] |
toSendableFormat()
This method transforms this file package into a byte array (byte[]) that is possible to send over a network stream |
Methods inherited from class peer2me.domain.DataPackage |
getRecipients, getSender, getType, setRecipients, setSender |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FilePackage(Node sender, java.lang.String[] recipients, java.lang.String filePath)
sender
- A node object representing the sender noderecipients
- The addresses to the recipients of the file packagefilePath
- The path of the file to be sentpublic FilePackage()
Method Detail |
public java.lang.String getFilePath()
public long getFileSize()
public byte[] toSendableFormat()
toSendableFormat
in class DataPackage
public void parseBytes(byte[] data)
parseBytes
in class DataPackage
data
- The byte[] containing the data representing the FilePackage object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |