NearShareStream Interface

public interface NearShareStream

This interface contains methods for reading file data to be transferred through nearby sharing. It is used by the platform during a share operation.

Method Summary

Modifier and Type Method and Description
void close()

This method is called when the system is finished transferring files or the operation failed. It should close any internal file streams or channels that were open.

void read(long offset, int size, ByteBuffer byteBuffer)

Reads the internal file data and writes it to the given **ByteBuffer** reference.

Method Details

close

public void close()

This method is called when the system is finished transferring files or the operation failed. It should close any internal file streams or channels that were open.

Throws:

IOException

read

public void read(long offset, int size, ByteBuffer byteBuffer)

Reads the internal file data and writes it to the given **ByteBuffer** reference.

Parameters:

offset - The number of bytes to offset the starting point of the read operation by.
size - The size, in bytes, of the data.
byteBuffer - A **ByteBuffer** instance into which the data will be written.

Applies to