code: private int completeRead(int b) throws IOException, StreamIntegrityException {
      if (b == END_OF_STREAM) {
        handleEndOfStream();
      } else {
        // Have we reached the end of the stream?
        int c = pushbackInputStream.read();
        if (c == END_OF_STREAM) {
          handleEndOfStream();
        } else {
          pushbackInputStream.unread(c);
        }
      }
  
      return b;
    }
docs: Updates the HMAC value and handles the end of stream.
  
  @param b
  the result of a read operation
  @return the value {@code b}
  @throws IOException
  @throws StreamIntegrityException