ByteBuffer expectedBuf = ByteBuffer.allocate( DATA_SIZE * COUNT );
for( int i = 0; i < COUNT; i ++ ) {
expectedBuf.limit( ( i + 1 ) * DATA_SIZE );
fillWriteBuffer( expectedBuf, i );
}
expectedBuf.position( 0 );
assertEquals(expectedBuf, readBuf);
}
private void waitForResponse( EchoConnectorHandler handler, int bytes ) throws InterruptedException