All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sencha.gxt.legacy.client.data.RpcMap_CustomFieldSerializer Maven / Gradle / Ivy

/**
 * Sencha GXT 3.1.1 - Sencha for GWT
 * Copyright(c) 2007-2014, Sencha, Inc.
 * [email protected]
 *
 * http://www.sencha.com/products/gxt/license/
 */
package com.sencha.gxt.legacy.client.data;

import java.util.Map.Entry;

import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;

public final class RpcMap_CustomFieldSerializer {

  public static void deserialize(SerializationStreamReader streamReader, RpcMap instance) throws SerializationException {
    int size = streamReader.readInt();

    for (int i = 0; i < size; ++i) {
      String key = streamReader.readString();
      Object value = streamReader.readObject();

      instance.put(key, value);
    }
  }

  public static void serialize(SerializationStreamWriter streamWriter, RpcMap instance) throws SerializationException {
    int size = instance.size();
    streamWriter.writeInt(size);

    for (Entry entry : instance.entrySet()) {
      streamWriter.writeString(entry.getKey());
      streamWriter.writeObject(entry.getValue());
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy