public final ConnectionState newInput() throws IOException {
  if (in.hasRemaining()) {
    throw new RuntimeException("data remaining in input");
  }
  in.clear();
  int r=ch.read(in);
  if (r == -1)   throw new IOException("connection closed on client side");
  if (r == 0)   return ConnectionState.SELECTOR_WAIT_FOR_NEW_INPUT;
  in.flip();
  return newRequestChunk();
}

public final ConnectionState newInput ( ) throws IOException { if ( in . hasRemaining ( ) ) { throw new RuntimeException ( "data remaining in input" ) ; } in . clear ( ) ; int r = ch . read ( in ) ; if ( r == - 1 ) throw new IOException ( "connection closed on client side" ) ; if ( r == 0 ) return ConnectionState . SELECTOR_WAIT_FOR_NEW_INPUT ; in . flip ( ) ; return newRequestChunk ( ) ; }
new data available for the connection .
