Latest downloadsProjectsDocumentationResources
CommunityUpcoming |
ErrorGeneratingFilter TutorialIntroductionThe ErrorGeneratingFilter is an IoFilter with to introduce random error in your data streams. The filter can insert/delete/modify bytes from the data stream with a specified probability. The CodeTo use an ErrorGeneratingFilter:
Instantiating the filterErrorGeneratingFilter egf = new ErrorGeneratingFilter(); Set Probability for modifying Data StreamFor activate the change of some bytes in your IoBuffer, for a probability of 200 out of 1000 IoBuffer processed : egf.setChangeByteProbability(200); or activate the insertion of some bytes in your IoBuffer, for a probability of 200 out of 1000 : egf.setInsertByteProbability(200); And for the removing of some bytes : egf.setRemoveByteProbability(200); Enable manipulation of read/write dataYou can activate the error generation for write or read with the following methods : egf.setManipulateReads(true); egf.setManipulateWrites(true); Now add it to filter chain, it'll generate the error at the given probability. |