# Class ByteArrayStreamingContent (2.1.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.1.0 (latest)](https://docs-0cloud-0google-0com.linkedin.net.nz/java/docs/reference/google-http-client/latest/com.google.api.client.util.ByteArrayStreamingContent)
- [2.0.3](https://docs-0cloud-0google-0com.linkedin.net.nz/java/docs/reference/google-http-client/2.0.3/com.google.api.client.util.ByteArrayStreamingContent)
- [1.47.1](https://docs-0cloud-0google-0com.linkedin.net.nz/java/docs/reference/google-http-client/1.47.1/com.google.api.client.util.ByteArrayStreamingContent)
- [1.46.3](https://docs-0cloud-0google-0com.linkedin.net.nz/java/docs/reference/google-http-client/1.46.3/com.google.api.client.util.ByteArrayStreamingContent)
- [1.45.3](https://docs-0cloud-0google-0com.linkedin.net.nz/java/docs/reference/google-http-client/1.45.3/com.google.api.client.util.ByteArrayStreamingContent)
- [1.44.2](https://docs-0cloud-0google-0com.linkedin.net.nz/java/docs/reference/google-http-client/1.44.2/com.google.api.client.util.ByteArrayStreamingContent)
- [1.43.2](https://docs-0cloud-0google-0com.linkedin.net.nz/java/docs/reference/google-http-client/1.43.2/com.google.api.client.util.ByteArrayStreamingContent)
- [1.42.3](https://docs-0cloud-0google-0com.linkedin.net.nz/java/docs/reference/google-http-client/1.42.3/com.google.api.client.util.ByteArrayStreamingContent)
- [1.41.8](https://docs-0cloud-0google-0com.linkedin.net.nz/java/docs/reference/google-http-client/1.41.8/com.google.api.client.util.ByteArrayStreamingContent)

    public class ByteArrayStreamingContent implements StreamingContent

**Deprecated.** *use com.google.common.io.ByteSource*

Streaming content whose source is a byte array.

Implementation is not thread-safe.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> ByteArrayStreamingContent

## Implements

[StreamingContent](https://docs-0cloud-0google-0com.linkedin.net.nz/java/docs/reference/google-http-client/latest/com.google.api.client.util.StreamingContent)

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Constructors

### ByteArrayStreamingContent(byte\[\] byteArray) (deprecated)

    public ByteArrayStreamingContent(byte[] byteArray)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `byteArray` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html[]` byte array content |

### ByteArrayStreamingContent(byte\[\] byteArray, int offset, int length) (deprecated)

    public ByteArrayStreamingContent(byte[] byteArray, int offset, int length)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `byteArray` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html[]` byte array content |
| `offset` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` starting offset into the byte array |
| `length` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` of bytes to read from byte array |

## Methods

### writeTo(OutputStream out) (deprecated)

    public void writeTo(OutputStream out)

Writes the byte content to the given output stream.

Implementations must not close the output stream, and instead should flush the output
stream. Some callers may assume that the output stream has not been closed, and will fail to
work if it has been closed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `out` | `https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html` |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |