Google is committed to advancing racial equity for Black communities. See how.

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()
Closes the ParcelFileDescriptor and InputStream to release resource.

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.

public void close ()

Closes the ParcelFileDescriptor and InputStream to release resource.