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.
void
close()
This method is deprecated. use Payload.close() instead.

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 Payload.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 Payload.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.

public void close ()

This method is deprecated.
use Payload.close() instead.

Closes the ParcelFileDescriptor and InputStream to release resource.