MemorySinkSource mem = new MemorySinkSource();
BatchingDecorator<EventSink> b = new BatchingDecorator<EventSink>(mem, 10,
0);
b.open();
for (int i = 0; i < 100; i++) {
Event e = new EventImpl(("canned data " + i).getBytes());
b.append(e);
}
MemorySinkSource mem2 = new MemorySinkSource();
GzipDecorator<EventSink> gz = new GzipDecorator<EventSink>(mem2);
Event be = mem.next();
gz.open();
gz.append(be);
Event gzbe = mem2.next();
MemorySinkSource mem3 = new MemorySinkSource();
GunzipDecorator<EventSink> gunz = new GunzipDecorator<EventSink>(mem3);
gunz.open();
gunz.append(gzbe);
Event gunze = mem3.next();
int origsz = new WriteableEvent(be).toBytes().length;
int gzipsz = new WriteableEvent(gzbe).toBytes().length;
int ungzsz = new WriteableEvent(gunze).toBytes().length;