This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
JSON_parseObject_InputStream_cn
wenshao edited this page May 2, 2016
·
1 revision
在1.2.11版本中,fastjson新增加了对InputStream的支持支持。
package com.alibaba.fastjson;
public abstract class JSON {
public static <T> T parseObject(InputStream is, //
Type type, //
Feature... features) throws IOException;
public static <T> T parseObject(InputStream is, //
Charset charset, //
Type type, //
Feature... features) throws IOException;
}
import com.alibaba.fastjson;
import java.nio.charset.Charset;
class Model {
public int value;
}
InputStream is = ...
Model model = JSON.parseObject(is, Model.class);
Model model2 = JSON.parseObject(is, Charset.from("UTF-8"), Model.class);
如有需要修改本注脚,请联系阿里巴巴,
© Alibaba Fastjson Develop Team
注明: 版权所有阿里巴巴,请注明版权所有者
If you need to amend this footnote, please contact Alibaba.
© Alibaba Fastjson Develop Team
Note: Copyright Alibaba, please indicate the copyright owner