Examples of readClassAndObject()


Examples of com.esotericsoftware.kryo.Kryo.readClassAndObject()

        try {
            final Kryo kryo = kryoThreadLocal.get();
            final byte[] payload = new byte[msg.readableBytes()];
            msg.readBytes(payload);
            try (final Input input = new Input(payload)) {
                final Map<String, Object> responseData = (Map<String, Object>) kryo.readClassAndObject(input);
                final Map<String, Object> status = (Map<String,Object>) responseData.get(SerTokens.TOKEN_STATUS);
                final Map<String, Object> result = (Map<String,Object>) responseData.get(SerTokens.TOKEN_RESULT);
                return ResponseMessage.build(UUID.fromString(responseData.get(SerTokens.TOKEN_REQUEST).toString()))
                        .code(ResponseStatusCode.getFromValue((Integer) status.get(SerTokens.TOKEN_CODE)))
                        .statusMessage(Optional.ofNullable((String) status.get(SerTokens.TOKEN_MESSAGE)).orElse(""))
View Full Code Here

Examples of com.esotericsoftware.kryo.Kryo.readClassAndObject()

        try {
            final Kryo kryo = kryoThreadLocal.get();
            final byte[] payload = new byte[msg.readableBytes()];
            msg.readBytes(payload);
            try (final Input input = new Input(payload)) {
                final Map<String, Object> requestData = (Map<String, Object>) kryo.readClassAndObject(input);
                final RequestMessage.Builder builder = RequestMessage.build((String) requestData.get(SerTokens.TOKEN_OP))
                        .overrideRequestId((UUID) requestData.get(SerTokens.TOKEN_REQUEST))
                        .processor((String) requestData.get(SerTokens.TOKEN_PROCESSOR));
                final Map<String, Object> args = (Map<String, Object>) requestData.get(SerTokens.TOKEN_ARGS);
                args.forEach(builder::addArg);
View Full Code Here

Examples of com.esotericsoftware.kryo.Kryo.readClassAndObject()

    kryo.writeClassAndObject(output, new MeasurePointData("2222"));
    kryo.writeClassAndObject(output, new MeasurePointData("2222"));
    kryo.writeClassAndObject(output, new MeasurePointData("1111"));
   
    Input input = new Input(output.getBuffer());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
View Full Code Here

Examples of com.esotericsoftware.kryo.Kryo.readClassAndObject()

    kryo.writeClassAndObject(output, new MeasurePointData("2222"));
    kryo.writeClassAndObject(output, new MeasurePointData("1111"));
   
    Input input = new Input(output.getBuffer());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
  }
View Full Code Here

Examples of com.esotericsoftware.kryo.Kryo.readClassAndObject()

    kryo.writeClassAndObject(output, new MeasurePointData("1111"));
   
    Input input = new Input(output.getBuffer());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
  }
 
View Full Code Here

Examples of com.esotericsoftware.kryo.Kryo.readClassAndObject()

   
    Input input = new Input(output.getBuffer());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
  }
 
 
View Full Code Here

Examples of com.esotericsoftware.kryo.Kryo.readClassAndObject()

    Input input = new Input(output.getBuffer());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
  }
 
 
  @Test
View Full Code Here

Examples of com.esotericsoftware.kryo.Kryo.readClassAndObject()

    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("2222", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
    assertEquals("1111", ((MeasurePointData)kryo.readClassAndObject(input)).getMeasurePointId());
  }
 
 
  @Test
  public void test_write(){
View Full Code Here

Examples of com.esotericsoftware.kryo.Kryo.readClassAndObject()

    assertEquals(43, latestTimestamp);
   
    Kryo kryo = new Kryo();
    Input input = new Input(new ByteBufferInputStream(b));
    input.setPosition(MonitoringDataStorage.FIRST_RECORD_POSITION);
    assertEquals("blabla1",((MonitoringDataDummy)kryo.readClassAndObject(input)).value);
    assertEquals("blabla2",((MonitoringDataDummy)kryo.readClassAndObject(input)).value);
    assertNull(kryo.readClassAndObject(input));
    b.putInt(MonitoringDataStorage.LIMIT_POSITION, b.position());
    b.position(0);
    ranAccess.close();
View Full Code Here

Examples of com.esotericsoftware.kryo.Kryo.readClassAndObject()

   
    Kryo kryo = new Kryo();
    Input input = new Input(new ByteBufferInputStream(b));
    input.setPosition(MonitoringDataStorage.FIRST_RECORD_POSITION);
    assertEquals("blabla1",((MonitoringDataDummy)kryo.readClassAndObject(input)).value);
    assertEquals("blabla2",((MonitoringDataDummy)kryo.readClassAndObject(input)).value);
    assertNull(kryo.readClassAndObject(input));
    b.putInt(MonitoringDataStorage.LIMIT_POSITION, b.position());
    b.position(0);
    ranAccess.close();
    }
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.