Google Data APIs Client Library (1.41.1)



com.google.gdata.client.uploader
Interface UploadData

All Known Implementing Classes:
ByteArrayUploadData, FileUploadData

public interface UploadData

A seekable, read-only buffer of data to be upload uploading.


Method Summary
 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.
 

Method Detail

length

long length()
Returns the total number of bytes of data in the buffer.


read

void read(byte[] destination)
          throws java.io.IOException
Reads up to destination.length bytes from the current position into the destination buffer.

Throws:
java.io.IOException - if the data could not be read.

read

int read(byte[] chunk,
         int i,
         int length)
         throws java.io.IOException
Reads up to length bytes into the chunk buffer.

Parameters:
i - the start offset in the destination buffer.
Throws:
java.io.IOException - if the data could not be read.

setPosition

void setPosition(long position)
                 throws java.io.IOException
Sets the offset from the start of the the source data from which the next read will begin.

Throws:
java.io.IOException - if position is negative or past the end of the data.