public void sendInstances ( Stream inputStream , int numberInstances , boolean isTraining , boolean isTesting ) { int numberSamples = 0 ; while ( streamSource . hasMoreInstances ( ) && numberSamples < numberInstances ) { numberSamples ++ ; numberInstancesSent ++ ; InstanceContentEvent instanceContentEvent = new InstanceContentEvent ( numberInstancesSent , nextInstance ( ) , isTraining , isTesting ) ; inputStream . put ( instanceContentEvent ) ; } InstanceContentEvent instanceContentEvent = new InstanceContentEvent ( numberInstancesSent , null , isTraining , isTesting ) ; instanceContentEvent . setLast ( true ) ; inputStream . put ( instanceContentEvent ) ; }
Send instances .