Payload.Stream

public static class Payload.Stream extends Object

Represents a stream of data.

Public Method Summary

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.

Inherited Method Summary

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.

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.