@Override public int read() throws IOException {
  while (in != null) {
    int result=in.read();
    if (result >= 0) {
      return result;
    }
    nextStream();
  }
  return -1;
}

@ Override public int read ( ) throws IOException { while ( in != null ) { int result = in . read ( ) ; if ( result >= 0 ) { return result ; } nextStream ( ) ; } return - 1 ; }
reads a single byte from this sequence of input streams and returns it as an integer in the range from 0 to 255 . it tries to read from the current stream first ; if the end of this stream has been reached , it reads from the next one . blocks until one byte has been read , the end of the last input stream in the sequence has been reached , or an exception is thrown .
