Interface InputPipe

All Superinterfaces:
Pipe
All Known Subinterfaces:
UsbInputPipe

public interface InputPipe extends Pipe
A pipe that can be used to read data.
Since:
API version 7
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    read(MemoryBlock data, int timeoutInMs)
    Requests to read some data from this pipe in a synchronous way (the caller is blocked until the transfer completes).
    void
    readAsync(MemoryBlock data, AsyncTransferCompledCallback callback, int timeoutInMs)
    Requests to read some data from this pipe in an asynchronous way (the caller is not blocked).
  • Method Details

    • readAsync

      void readAsync(MemoryBlock data, AsyncTransferCompledCallback callback, int timeoutInMs)
      Requests to read some data from this pipe in an asynchronous way (the caller is not blocked). Once some data has been read the callback will be notified on the controller's thread.
      Parameters:
      data - A MemoryBlock that can receive the data that is read.
      callback - A callback that is notified on the controller's thread when the read has completed.
      timeoutInMs - A timeout in milliseconds that will result in an error and termination of the controller if the read does not happen in this time. For inifnite timeout use 0.
    • read

      int read(MemoryBlock data, int timeoutInMs)
      Requests to read some data from this pipe in a synchronous way (the caller is blocked until the transfer completes).
      Parameters:
      timeoutInMs - A timeout in milliseconds that will result in an error and termination of the controller if the read does not happen in this time. For inifinite timeout use 0.
      Returns:
      The number of bytes that was read.