Class ByteArrayDownloadTarget
java.lang.Object
net.sf.basedb.opengrid.filetransfer.AbstractFileTransfer
net.sf.basedb.opengrid.filetransfer.ByteArrayDownloadTarget
- All Implemented Interfaces:
DownloadTarget
Download target implementation for getting the
remote file as a byte array.
- Since:
- 1.0
- Author:
- nicklas
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a new byte array download target with "unlimited" size. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getData()
Get the downloaded data as a byte array.int
Get the size of the downloaded data.Get an ouput stream for writing the file data to the local resource.Get the downloaded data as a string.Methods inherited from class net.sf.basedb.opengrid.filetransfer.AbstractFileTransfer
getMetadata, getName, initMetadata
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.basedb.opengrid.filetransfer.DownloadTarget
getMetadata, getName
-
Field Details
-
limit
private final int limit -
data
-
-
Constructor Details
-
ByteArrayDownloadTarget
Create a new byte array download target with "unlimited" size.- Parameters:
name
- The name of the "file"
-
-
Method Details
-
getOutputStream
Description copied from interface:DownloadTarget
Get an ouput stream for writing the file data to the local resource.- Specified by:
getOutputStream
in interfaceDownloadTarget
-
getDownloadedSize
public int getDownloadedSize()Get the size of the downloaded data. -
getData
public byte[] getData()Get the downloaded data as a byte array. Note that a copy is made for each call to this method. If no data has been downloaded null is returned. -
getString
Get the downloaded data as a string. If no data has been downloaded null is returned.
-