public static class

Payload.Stream

extends Object
java.lang.Object
   ↳ com.google.android.gms.nearby.connection.Payload.Stream

Class Overview

Represents a stream of data.

Summary

Public Methods
InputStream asInputStream()
Gets the InputStream from which to read the data for this Stream.
ParcelFileDescriptor asParcelFileDescriptor()
Gets the ParcelFileDescriptor from which to read the data for this Stream.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public InputStream asInputStream ()

Gets the InputStream from which to read the data for this Stream.

When receiving a Payload of type STREAM, Nearby Connections will continuously write the incoming streamed data to this InputStream; when no more data is available (likely because the sending device stopped streaming data), this InputStream will be closed.

Returns
InputStream

public ParcelFileDescriptor asParcelFileDescriptor ()

Gets the ParcelFileDescriptor from which to read the data for this Stream.

When receiving a Payload of type STREAM, Nearby Connections will continuously write the incoming streamed data to this ParcelFileDescriptor; when no more data is available (likely because the sending device stopped streaming data), this ParcelFileDescriptor will be closed.

Returns
ParcelFileDescriptor