|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.faban.common.FileTransfer
public class FileTransfer
The FileTransfer class represents a file to be transferred via RMI from one to the other system. We override the serialization mechanism to ensure we don't need to suck the file's content into memory causing memory bloat. This is useful for transferring large files over RMI. As this object gets serialized, deserialized, the file transfer happens internally and the destination file gets created as a result of the deserialization. The file size limit is Long.MAX_VALUE (64bit).
Constructor Summary | |
---|---|
FileTransfer()
The noarg constructore is used for deserializing. |
|
FileTransfer(byte[] buffer,
int offset,
int length,
String dest)
Creates a file transfer object from a byte buffer. |
|
FileTransfer(String src,
String dest)
Creates a file transfer object. |
Method Summary | |
---|---|
String |
getDest()
Obtains the destination file name. |
long |
getSize()
Obtains the size of the file transferred, or 0 if the file transfer has not yet happen. |
String |
getSource()
Obtains the sources file name. |
long |
getTransferSize()
Obtains the size to be transferred on the sending side, or the size really transferred on the receiving side. |
void |
readExternal(ObjectInput in)
|
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileTransfer(String src, String dest) throws IOException
src
- The source file namedest
- The destination file name
IOException
- Error reading the file to be transferredpublic FileTransfer(byte[] buffer, int offset, int length, String dest)
buffer
- The bufferoffset
- The starting offset to uselength
- The length of data to use, in bytesdest
- The destination filepublic FileTransfer()
Method Detail |
---|
public String getSource()
public String getDest()
public long getSize()
public long getTransferSize()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |