public void runTest(Object ctx, int numReps) {
   final Context ictx = (Context) ctx;
   final ImageInputStream iis = ictx.inputStream;
   final int length = ictx.length * 8;
   int pos = 0;
   try {
     iis.mark();
     do {
       if (pos >= length) {
         iis.reset();
         iis.mark();
         pos = 0;
       }
       iis.readBit();
       pos++;
     } while (--numReps >= 0);
   } catch (IOException e) {
     e.printStackTrace();
   } finally {
     try {
       iis.reset();
     } catch (IOException e) {
     }
   }
 }