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 ) ; } }
Marks the input stream as EOF since no further reads should be done .