# Google Data APIs Client Library (1.43.0)

## com.google.gdata.client.uploader
Class ByteArrayUploadData

    java.lang.Object
      com.google.gdata.client.uploader.ByteArrayUploadData

All Implemented Interfaces:
  UploadData

    public class ByteArrayUploadData

extends java.lang.Object
implements UploadData

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

Constructor Summary
`ByteArrayUploadData(byte[] buffer)`

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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ByteArrayUploadData

    public ByteArrayUploadData(byte[] buffer)

Method Detail

### length

    public long length()

  Description copied from interface: `UploadData`
  Returns the total number of bytes of data in the buffer.

  Specified by:
    `length` in interface `UploadData`

### read

    public void read(byte[] destination)
              throws java.io.IOException

  Description copied from interface: `UploadData`
  Reads up to `destination.length` bytes from the current position into the destination buffer.

  Specified by:
    `read` in interface `UploadData`
  Throws:
    `java.io.IOException` - if the data could not be read.

### setPosition

    public void setPosition(long position)

  Description copied from interface: `UploadData`
  Sets the offset from the start of the the source data from which the next `read` will begin.

  Specified by:
    `setPosition` in interface `UploadData`

### read

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

  Description copied from interface: `UploadData`
  Reads up to `length` bytes into the `chunk` buffer.

  Specified by:
    `read` in interface `UploadData`
    `i` - the start offset in the destination buffer.