diff --git a/convert.html b/convert.html index 4d538f59b..3d022955a 100644 --- a/convert.html +++ b/convert.html @@ -72,8 +72,8 @@ public <T> T convertFrom(final Type type, final JsonReader reader); -

        Convert 与 ByteBuffer 的结合

-

        从以上的方法可以看出,与其他JSON框架相比Convert多了与ByteBuffer结合的方法。特别是convertTo方法加了Supplier<ByteBuffer>方法,这么做是为了提高数据传输的性能。在大部分情况下JSON序列化得到的数据流是为了传输出去,常见的场景就是HTTP+JSON接口。Convert提供ByteBuffer接口会大量减少中间临时数据的产生。大部分输出JSON数据的方法如下: +

        Convert 与 ByteBuffer 的结合

+

        从以上的方法可以看出,与其他JSON框架相比Convert多了与ByteBuffer结合的方法。特别是convertTo方法加了Supplier<ByteBuffer>方法,这么做是为了提高数据传输的性能。在大部分情况下JSON序列化得到的数据流是为了传输出去,常见的场景就是HTTP+JSON接口。Convert提供ByteBuffer接口会大量减少中间临时数据的产生。大部分输出JSON数据的方法如下:

    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
         String json = new Gson().toJson(record);