本文整理汇总了Java中com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader类的典型用法代码示例。如果您正苦于以下问题:Java ClientSerializationStreamReader类的具体用法?Java ClientSerializationStreamReader怎么用?Java ClientSerializationStreamReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClientSerializationStreamReader类属于com.google.gwt.user.client.rpc.impl包,在下文中一共展示了ClientSerializationStreamReader类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createStreamReader
import com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader; //导入依赖的package包/类
@Override
public SerializationStreamReader createStreamReader(String encoded) throws SerializationException {
ClientSerializationStreamReader clientSerializationStreamReader =
new ClientSerializationStreamReader(this.serializer);
String encodedResponse = encoded;
if (encoded.startsWith("//OK") || encodedResponse.startsWith("//EX")) {
encodedResponse = encodedResponse.substring(4);
}
clientSerializationStreamReader.prepareToRead(encodedResponse);
return clientSerializationStreamReader;
}
示例2: deserialize
import com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T> T deserialize(Class<? super T> clazz, String serializedString) throws SerializationException {
if (serializedString == null) {
return null;
}else if(String.class.equals(clazz)){
return (T) serializedString;
}
ClientSerializationStreamReader reader = new ClientSerializationStreamReader(TYPE_SERIALIZER);
reader.prepareToRead(serializedString);
Object obj = findType(clazz).read(reader);
return obj != null ? (T) obj : null;
}