public class

ByteArrayUploadData

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

Class Overview

An implementation of UploadData that provides data from a byte[].

Summary

Fields
private final byte[] buffer
private final ByteArrayInputStream stream
Public Constructors
ByteArrayUploadData(byte[] buffer)
Public Methods
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 byte[] buffer

private final ByteArrayInputStream stream

Public Constructors

public ByteArrayUploadData (byte[] buffer)

Parameters
buffer

Public Methods

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

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