void disconnect(){
synchronized (lock) {
    disconnected=true;
    lock.notifyAll();
  }
}

void disconnect ( ) { synchronized ( lock ) { disconnected = true ; lock . notifyAll ( ) ; } }
disconnect this stream from all connection activity .
