}
public void write(Event ev)
{
int index = ev.getHash() % workers.length;
EncryptEventV2 encrypt = new EncryptEventV2();
IniProperties cfg = SnovaConfiguration.getInstance().getIniProperties();
String enc = cfg.getProperty("C4", "Encrypter", "RC4");
if (enc.equalsIgnoreCase("RC4"))
{
encrypt.type = EncryptType.RC4;
}
else if (enc.equalsIgnoreCase("SE1"))
{
encrypt.type = EncryptType.SE1;
}
else
{
encrypt.type = EncryptType.NONE;
}
encrypt.ev = ev;
encrypt.setHash(ev.getHash());
Buffer buf = new Buffer(256);
BufferHelper.writeFixInt32(buf, 1, true);
encrypt.encode(buf);
int tmp = buf.getWriteIndex();
int len = tmp - 4;
buf.setWriteIndex(0);
BufferHelper.writeFixInt32(buf, len, true);
buf.setWriteIndex(tmp);