Interface B2ByteProgressListener


  • public interface B2ByteProgressListener
    This listener is called as data is read from an input stream. It is called synchronously before the caller receives the data from the stream. (1) keep in mind that the time you spend listening is directly slowing down the processing of the stream. (2) keep in mind that you're learning about things before the stream's caller. In particular, if you're using this as a proxy for the amount of data that's been sent to server, remember that it's not really a measure of that. Many things can happen before the data is sent (and being sent isn't the same as being processed by the server!). Higher-level indications (like receiving the response from the server) are better indications that the server has processed your data!
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void hitException​(java.lang.Exception e, long nBytesSoFar)
      Called right before the exception propagates to the caller.
      void progress​(long nBytesSoFar)
      Called right before returning bytes to the caller.
      void reachedEof​(long nBytesSoFar)
      Called right before the caller learns that we've hit the end of the stream.
    • Method Detail

      • progress

        void progress​(long nBytesSoFar)
        Called right before returning bytes to the caller.
        Parameters:
        nBytesSoFar - the total number of bytes read from the stream so far.
      • hitException

        void hitException​(java.lang.Exception e,
                          long nBytesSoFar)
        Called right before the exception propagates to the caller.
        Parameters:
        e - the exception that was thrown
        nBytesSoFar - the total number of bytes read from the stream so far.
      • reachedEof

        void reachedEof​(long nBytesSoFar)
        Called right before the caller learns that we've hit the end of the stream.
        Parameters:
        nBytesSoFar - the total number of bytes read from the stream so far.