且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Java序列化问题,同时使用番石榴Lists.transform

更新时间:2023-11-15 20:19:40

Lists.transform()确实像您怀疑的那样执行缓慢.您可以做以下其中一项

Lists.transform() does perform lazily as you suspected. You could do one of

Lists.newArrayList(Lists.transform(...))

或者,如果您想要一个不变的版本,

or, if you want an immutable version,

ImmutableList.copyOf(Lists.transform(...))

,然后序列化结果列表.

and then serialize the resulting list.