当前位置: 首页>>代码示例>>Java>>正文


Java PersistenceUtils.deserializeState方法代码示例

本文整理汇总了Java中com.google.ipc.invalidation.ticl.PersistenceUtils.deserializeState方法的典型用法代码示例。如果您正苦于以下问题:Java PersistenceUtils.deserializeState方法的具体用法?Java PersistenceUtils.deserializeState怎么用?Java PersistenceUtils.deserializeState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.ipc.invalidation.ticl.PersistenceUtils的用法示例。


在下文中一共展示了PersistenceUtils.deserializeState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decodeTiclState

import com.google.ipc.invalidation.ticl.PersistenceUtils; //导入方法依赖的package包/类
/**
 * Returns the persisted state for the client with key {@code clientKey} in
 * {@code storageForClient}, or {@code null} if no valid state could be found.
 * <p>
 * REQUIRES: {@code storageForClient}.load() has been called successfully.
 */


PersistentTiclState decodeTiclState(final String clientKey, AndroidStorage storageForClient) {
  synchronized (lock) {
    // Retrieve the serialized state.
    final Map<String, byte[]> properties = storageForClient.getPropertiesUnsafe();
    byte[] clientStateBytes = TypedUtil.mapGet(properties,
        InvalidationClientCore.CLIENT_TOKEN_KEY);
    if (clientStateBytes == null) {
      logger.warning("No client state found in storage for %s: %s", clientKey,
          properties.keySet());
      return null;
    }

    // Deserialize it.
    PersistentTiclState clientState =
        PersistenceUtils.deserializeState(logger, clientStateBytes, digestFn);
    if (clientState == null) {
      logger.warning("Invalid client state found in storage for %s", clientKey);
      return null;
    }
    return clientState;
  }
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:31,代码来源:AndroidInvalidationService.java


注:本文中的com.google.ipc.invalidation.ticl.PersistenceUtils.deserializeState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。