public class

FileUploadData

extends Object
implements UploadData
java.lang.Object
   ↳ com.google.gdata.client.uploader.FileUploadData

Class Overview

An implementation of UploadData that provides data from a File.

Summary

Fields
private final File file
private FileInputStream stream
Public Constructors
FileUploadData(File file)
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gdata.client.uploader.UploadData

Fields

private final File file

private FileInputStream stream

Public Constructors

public FileUploadData (File file)

Parameters
file
Throws
IOException

Public Methods

public String getFileName ()

Gets the filename.

Returns
  • the local file name

public long length ()

Returns the total number of bytes of data in the buffer.

public void read (byte[] destination)

Reads up to destination.length bytes from the current position into the destination buffer.

Parameters
destination
Throws
IOException

public int read (byte[] chunk, int i, int length)

Reads up to length bytes into the chunk buffer.

Parameters
chunk
i The start offset in the destination buffer.
length
Throws
IOException

public void setPosition (long position)

Sets the offset from the start of the the source data from which the next read will begin.

Parameters
position
Throws
IOException