Package marauroa.common.net

Examples of marauroa.common.net.InputSerializer.readObject()


    os.write(attr);

    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    InputSerializer is = new InputSerializer(in);

    Attributes result = (Attributes) is.readObject(new Attributes(null));

    assertEquals(attr, result);
  }

  /**
 
View Full Code Here


    os.write(attr);

    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    InputSerializer is = new InputSerializer(in);

    Attributes result = (Attributes) is.readObject(new Attributes(null));

    assertEquals(attr, result);
  }

  /**
 
View Full Code Here

    os.write(attr);

    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    InputSerializer is = new InputSerializer(in);

    Attributes result = (Attributes) is.readObject(new Attributes(null));

    assertEquals(attr, result);
  }
 
  /**
 
View Full Code Here

    os.write(obj);

    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    InputSerializer is = new InputSerializer(in);

    RPObject result = (RPObject) is.readObject(new RPObject());

    assertEquals(obj, result);
   
    RPSlot inslot = result.getSlot("lhand");
    for ( RPObject contained : inslot) {
View Full Code Here

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    OutputSerializer os = new OutputSerializer(out);
    os.write(rpo);
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    InputSerializer is = new InputSerializer(in);
    RPObject result = (RPObject) is.readObject(new RPObject());
    assertEquals(rpo, result);
  }
 
  @Test
  public void testMapSerializationTwoMaps() throws IOException {
View Full Code Here

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    OutputSerializer os = new OutputSerializer(out);
    os.write(rpo);
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    InputSerializer is = new InputSerializer(in);
    RPObject result = (RPObject) is.readObject(new RPObject());
    assertEquals(rpo, result);
  }
 
  class SubRPObject extends RPObject{
    // just subclass of RPObject used for testing for of the
View Full Code Here

      ByteArrayInputStream inStream = new ByteArrayInputStream(content);
      InflaterInputStream szlib = new InflaterInputStream(inStream, new Inflater());
      InputSerializer inputSerializer = new InputSerializer(szlib);
      inputSerializer.setProtocolVersion(protocolVersion);

      RPObject object = (RPObject) inputSerializer.readObject(new RPObject());

      if (transform) {
        object = factory.transform(object);
      }
View Full Code Here

      int amount = inputSerializer.readInt();

      for (int i = 0; i < amount; i++) {
        try {
          RPObject object = factory.transform((RPObject) inputSerializer.readObject(new RPObject()));

          if (object != null) {
            /* Give the object a valid id and add it */
            zone.assignRPObjectID(object);
            zone.add(object);
 
View Full Code Here

    contents = serializer.readStringArray();

    int size = serializer.readInt();
    for (int i = 0; i < size; ++i) {
      serializer.readObject(new RPClass());
    }

    if (type != MessageType.S2C_SERVERINFO) {
      throw new IOException();
    }
View Full Code Here

    LayerDefinition layer = new LayerDefinition(0, 0);

    final InflaterInputStream szlib = new InflaterInputStream(in, new Inflater());
    final InputSerializer ser = new InputSerializer(szlib);

    layer = (LayerDefinition) ser.readObject(layer);
    layer.build();
    return layer;
  }

  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.