Interface AsyncInputStream.Listener

All Known Implementing Classes:
IdleTimeoutInputStream
Enclosing class:
AsyncInputStream

public static interface AsyncInputStream.Listener
Callback interface required by AsyncInputStream.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Handle end-of-file detected on the underlying input.
    void
    Handle an exception detected on the underlying input.
    void
    handleInput(byte[] buf, int off, int len)
    Handle new data read from the underlying input.
  • Method Details

    • handleInput

      void handleInput(byte[] buf, int off, int len)
      Handle new data read from the underlying input. This method must not write to buffer bytes outside of the defined region.
      Parameters:
      buf - data buffer
      off - starting offset of data in buffer
      len - number of bytes of data
    • handleException

      void handleException(Throwable e)
      Handle an exception detected on the underlying input. No further events will be delivered.

      Typically the assocaited AsyncInputStream will be closed in this callback.

      Parameters:
      e - the exception received (usually IOException but could also be any other RuntimeException)
    • handleEOF

      void handleEOF()
      Handle end-of-file detected on the underlying input. No further events will be delivered.

      Typically the assocaited AsyncInputStream will be closed in this callback.