Examples of OutputSerializer


Examples of marauroa.common.net.OutputSerializer

      tcInn.data[i]=(byte)i;
    }

    ByteArrayOutputStream out = new ByteArrayOutputStream();

    tcInn.writeFULL(new OutputSerializer(out));
    InputSerializer in = new InputSerializer(new ByteArrayInputStream(out.toByteArray()));

    TransferContent tcOut = new TransferContent();
    tcOut.readFULL(in);
    assertEquals(tcInn.ack,tcOut.ack);
View Full Code Here

Examples of marauroa.common.net.OutputSerializer

   * @throws IOException
   */
  public byte[] encode() throws IOException {
    final ByteArrayOutputStream array = new ByteArrayOutputStream();
    final DeflaterOutputStream out_stream = new DeflaterOutputStream(array);
    final OutputSerializer out = new OutputSerializer(out_stream);

    writeObject(out);
    out_stream.close();

    return array.toByteArray();
View Full Code Here

Examples of marauroa.common.net.OutputSerializer

      throws IOException {
    /*
     * Serialize the tileset data to send it to client.
     */
    final ByteArrayOutputStream array = new ByteArrayOutputStream();
    final OutputSerializer out = new OutputSerializer(array);

    int amount = 0;

    for (final TileSetDefinition set : tilesets) {
      if (!set.getSource().contains("logic/")) {
        amount++;
      }

    }

    out.write(amount);
    for (final TileSetDefinition set : tilesets) {
      if (!set.getSource().contains("logic/")) {
        set.writeObject(out);
      }
    }
View Full Code Here

Examples of marauroa.common.net.OutputSerializer

    return source;
  }

  public byte[] encode() throws IOException {
    final ByteArrayOutputStream array = new ByteArrayOutputStream();
    final OutputSerializer out = new OutputSerializer(array);

    writeObject(out);

    return array.toByteArray();
  }
View Full Code Here

Examples of marauroa.common.net.OutputSerializer

  @Test
  public void testSerialization() throws IOException { //, ClassNotFoundException
    final List<TileSetDefinition> tilesets = map.getTilesets();

    final ByteArrayOutputStream array = new ByteArrayOutputStream();
    final OutputSerializer out = new OutputSerializer(array);

    out.write(tilesets.size());
    for (final TileSetDefinition set : tilesets) {
      set.writeObject(out);
    }

    final byte[] serialized = array.toByteArray();
View Full Code Here

Examples of marauroa.common.net.OutputSerializer

   * Tests for serialization.
   */
  @Test
  public void testSerialization() throws IOException { //, ClassNotFoundException
    final ByteArrayOutputStream array = new ByteArrayOutputStream();
    final OutputSerializer out = new OutputSerializer(array);

    final LayerDefinition layer = map.getLayer("layer1");
    layer.writeObject(out);

    final byte[] serialized = array.toByteArray();
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.