Package com.esotericsoftware.kryo

Examples of com.esotericsoftware.kryo.Kryo


   *           deserialized.
   *           <p>
   *           The object buffers should be sized at least as large as the largest object that will be sent or received.
   */
  public Server (int writeBufferSize, int objectBufferSize) {
    this(writeBufferSize, objectBufferSize, new Kryo());
  }
View Full Code Here


   *           deserialized.
   *           <p>
   *           The object buffers should be sized at least as large as the largest object that will be sent or received.
   */
  public Client (int writeBufferSize, int objectBufferSize) {
    this(writeBufferSize, objectBufferSize, new Kryo());
  }
View Full Code Here

    protected byte[][] table;
    protected int tableEntrySize;

    private ImmutableBloomierFilter(int m, int k, int q, Class<V> valueClass) {
        kryo = new Kryo();
        kryo.setRegistrationOptional(true);
        kryoSerializer = new ObjectBuffer(kryo, DEFAULT_OBJECT_BUFFER_INITIAL_SIZE,
                                          Integer.MAX_VALUE);

        this.m = m;
View Full Code Here

      }
    });


    client = new Client();
    Kryo kryo = client.getKryo();
    registerKryo(kryo);
   
    client.addListener(networkListener);
   
    try {
View Full Code Here

public class Network {
        static public final int port = 54555;

        // This registers objects that are going to be sent over the network.
        static public void register (EndPoint endPoint) {
                Kryo kryo = endPoint.getKryo();
                kryo.register(RegisterName.class);
                kryo.register(String[].class);
                kryo.register(UpdateNames.class);
                kryo.register(ChatMessage.class);
        }
View Full Code Here

    }
  }
   
    // This registers objects that are going to be sent over the network.
    static public void register (EndPoint endPoint) {
            Kryo kryo = endPoint.getKryo();
            kryo.register(ArrayList.class);
            kryo.register(RegisterName.class);
            kryo.register(SimpleUnit.class);
            kryo.register(UnitType.class);
    }
View Full Code Here

    }
  }
   
    // This registers objects that are going to be sent over the network.
    static public void register (EndPoint endPoint) {
            Kryo kryo = endPoint.getKryo();
            kryo.register(ArrayList.class);
            kryo.register(RegisterName.class);
            kryo.register(SimpleUnit.class);
            kryo.register(UnitType.class);
            kryo.register(Garden.class);
            kryo.register(int[].class);
            kryo.register(GardenSpaceType.class);
            kryo.register(GardenSpaceType[][].class);
            kryo.register(UnitLion.class);
            kryo.register(UnitGazelle.class);
            kryo.register(UnitElephant.class);
            kryo.register(UnitOstrich.class);
            kryo.register(UnitTreeOfLife.class);
            kryo.register(EndGameStats.class);
            kryo.register(ClearRequest.class);
    }
View Full Code Here

/** Class to create a new Kryo instance.
* Used in initial configuration or pooling of Kryo objects.
* These objects are immutable (and hopefully Kryo serializable)
*/
public class KryoInstantiator implements Serializable {
  public Kryo newKryo() { return new Kryo(); }
View Full Code Here

  /** If true, Kryo will error if it sees a class that has not been registered
   */
  public KryoInstantiator setInstantiatorStrategy(final InstantiatorStrategy inst) {
    return new KryoInstantiator() {
      public Kryo newKryo() {
        Kryo k = KryoInstantiator.this.newKryo();
        k.setInstantiatorStrategy(inst);
        return k;
      }
    };
  }
View Full Code Here

   * some cases
   */
  public KryoInstantiator setReferences(final boolean ref) {
    return new KryoInstantiator() {
      public Kryo newKryo() {
        Kryo k = KryoInstantiator.this.newKryo();
        /**
         * Kryo 2.17, used in storm, has this method returning void,
         * 2.21 has it returning boolean.
         * Try not to call the method if you don't need to.
         */
        if(k.getReferences() != ref) { k.setReferences(ref); }
        return k;
      }
    };
  }
View Full Code Here

TOP

Related Classes of com.esotericsoftware.kryo.Kryo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.