Map<String, byte[]> fields = new HashMap<String, byte[]>();
byte[] data = { 'd', 'a', 't', 'a' };
fields.put("test", data);
WriteableEvent e = new WriteableEvent(
new EventImpl(s.getBytes(), Clock.unixTime(), Priority.INFO, Clock
.nanos(), NetUtils.localhost(), fields));
ByteArrayOutputStream bas = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(bas);
e.write(out);
out.flush();