Previously, CacheSerializer threw IOException for the convenience of
implementors, since some implementations were based on APIs like
InputStream/OutputStream that threw IOException. However, this didn't
cover all the possible exceptions that could be thrown; callers also
neded to be prepared to catch RuntimeException. Throwing checked
exceptions in some case and unchecked exceptions in others might have
given the impression that these cases were fundamentally different and
required different handling, which is not the case.
In addition, generally speaking, these classes are null-hostile. Use
checkNotNull in EnumCacheSerializer so the intent is clear.
Also in EnumCacheSerializer, delegate to Enums#stringConverter rather
than rolling our own.
Change-Id: I37f1cf73d961be477af389c4043bb1c10c45972c