public class FileUploadData extends Object implements UploadData
UploadData that provides data from a File.| Constructor and Description |
|---|
FileUploadData(File file) |
| Modifier and Type | Method and Description |
|---|---|
String |
getFileName()
Gets the filename.
|
long |
length()
Returns the total number of bytes of data in the buffer.
|
void |
read(byte[] destination)
Reads up to
destination.length bytes from the current position into
the destination buffer. |
int |
read(byte[] chunk,
int i,
int length)
Reads up to
length bytes into the chunk buffer. |
void |
setPosition(long position)
Sets the offset from the start of the the source data from which the next
read will begin. |
public FileUploadData(File file) throws IOException
IOExceptionpublic long length()
UploadDatalength in interface UploadDatapublic void read(byte[] destination)
throws IOException
UploadDatadestination.length bytes from the current position into
the destination buffer.read in interface UploadDataIOException - if the data could not be read.public void setPosition(long position)
throws IOException
UploadDataread will begin.setPosition in interface UploadDataIOException - if position is negative or past the end of the data.public int read(byte[] chunk,
int i,
int length)
throws IOException
UploadDatalength bytes into the chunk buffer.read in interface UploadDatai - the start offset in the destination buffer.IOException - if the data could not be read.public String getFileName()
Copyright © 2012. All Rights Reserved.