private void sendNextSketchBlock ( ) { byte [ ] rawBlock = sketchBlocksToSend . get ( currSketchBlockNum ) ; Buffer block = new Buffer ( ) ; block . write ( rawBlock ) ; sendMessage ( BeanMessageID . BL_FW_BLOCK , block ) ; resetSketchBlockSendTimeout ( ) ; int blocksSent = currSketchBlockNum + 1 ; int totalBlocks = sketchBlocksToSend . size ( ) ; onSketchUploadProgress . onResult ( UploadProgress . create ( blocksSent , totalBlocks ) ) ; currSketchBlockNum ++ ; if ( currSketchBlockNum >= sketchBlocksToSend . size ( ) ) { resetSketchUploadState ( ) ; } }
Send one block of sketch data to the Bean and increment the block counter .