protected byte[] generateData(int size,DataType type,Random rng){
  int min=Byte.MIN_VALUE;
  int max=Byte.MAX_VALUE;
  if (type == DataType.TEXT) {
    min=32;
    max=126;
  }
  byte[] result=new byte[size];
  Log.i(LOG_TAG,"Generating data of size: " + size);
  if (rng == null) {
    rng=new LoggingRng();
  }
  for (int i=0; i < size; ++i) {
    result[i]=(byte)(min + rng.nextInt(max - min + 1));
  }
  return result;
}

protected byte [ ] generateData ( int size , DataType type , Random rng ) { int min = Byte . MIN_VALUE ; int max = Byte . MAX_VALUE ; if ( type == DataType . TEXT ) { min = 32 ; max = 126 ; } byte [ ] result = new byte [ size ] ; Log . i ( LOG_TAG , "Generating data of size: " + size ) ; if ( rng == null ) { rng = new LoggingRng ( ) ; } for ( int i = 0 ; i < size ; ++ i ) { result [ i ] = ( byte ) ( min + rng . nextInt ( max - min + 1 ) ) ; } return result ; }
helper to generate a random blob of bytes using a given rng .
