/**
* Returns a {@link ByteArraySerializer} capable of serializing an object graph containing fibers.
*/
public static ByteArraySerializer getFiberSerializer() {
final KryoSerializer s = new KryoSerializer();
s.getKryo().addDefaultSerializer(Fiber.class, new FiberSerializer());
s.getKryo().addDefaultSerializer(ThreadLocal.class, new ThreadLocalSerializer());
s.getKryo().addDefaultSerializer(FiberWriter.class, new FiberWriterSerializer());
s.getKryo().register(Fiber.class);
s.getKryo().register(ThreadLocal.class);
s.getKryo().register(InheritableThreadLocal.class);
s.getKryo().register(FiberWriter.class);
return s;
}