code: private int onException(Exception e) throws IOException {
          eofReached = true;
          if (e instanceof IOException) {
              throw (IOException) e;
          } else if (e instanceof RuntimeException) {
              throw (RuntimeException) e;
          } else {
              // Impossible since InputStream throws no other checked exceptions.
              throw Throwables.failure(e);
          }
      }
docs: Marks the input stream as EOF since no further reads should be done.
  
  @param e Exception thrown by delegate stream.
  @return Noting, just for return signature.
  @throws IOException or {@link RuntimeException}