static Logger log = LoggerFactory.getLogger( GenerateLargeEvent.class );
public static void writeRandomData( PrintWriter writer, long size ){
Base64Codec b64 = new Base64Codec();
Random rnd = new Random();
long written = 0;
final byte[] buf = new byte[16 * 1024];
rnd.nextBytes( buf );
char[] newline = new char[]{ '\r', '\n' };
while( written < size ){
Long remain = size - written;
int write = Math.min( buf.length, remain.intValue() );
byte[] encoded = b64.encode( buf );
for( int i = 0; i < write && i < buf.length; i++ ){
writer.write( (int) encoded[i] );
written++;
if( i > 0 && written % 80 == 0 ){
writer.write( newline );