Java 类com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader 实例源码

项目:putnami-web-toolkit    文件:CommandSerializationStreamFactory.java   
@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;
}
项目:gwt-storage    文件:StorageRPCSerializerImpl.java   
@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;
}