public class ByteArrayUploadData extends java.lang.Object implements UploadData
UploadData
that provides data from a byte[]
.Constructor and Description |
---|
ByteArrayUploadData(byte[] buffer) |
Modifier and Type | Method and Description |
---|---|
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 long length()
UploadData
length
in interface UploadData
public void read(byte[] destination) throws java.io.IOException
UploadData
destination.length
bytes from the current position into
the destination buffer.read
in interface UploadData
java.io.IOException
- if the data could not be read.public void setPosition(long position)
UploadData
read
will begin.setPosition
in interface UploadData
public int read(byte[] chunk, int i, int length)
UploadData
length
bytes into the chunk
buffer.read
in interface UploadData
i
- the start offset in the destination buffer.