public void received(ByteBuffer buffer){
  hasReceivedData=true;
  lastReceiveTime=System.currentTimeMillis();
}

public void received ( ByteBuffer buffer ) { hasReceivedData = true ; lastReceiveTime = System . currentTimeMillis ( ) ; }
method called when data is received .
