Package com.esotericsoftware.kryo

Examples of com.esotericsoftware.kryo.Serializer.writeObject()


      }

      for (int i = 0, n = cachedMethod.serializers.length; i < n; i++) {
        Serializer serializer = cachedMethod.serializers[i];
        if (serializer != null)
          serializer.writeObject(buffer, args[i]);
        else
          kryo.writeClassAndObject(buffer, args[i]);
      }

      if (method.getReturnType() != void.class) buffer.put(responseID);
View Full Code Here


          if (serializer == null)
            cachedField.serializer = serializer = kryo.getRegisteredClass(cachedField.fieldClass).getSerializer();
          if (!cachedField.canBeNull)
            serializer.writeObjectData(buffer, value);
          else
            serializer.writeObject(buffer, value);
        }
      } catch (IllegalAccessException ex) {
        throw new SerializationException("Error accessing field: " + cachedField + " (" + object.getClass().getName() + ")",
          ex);
      } catch (SerializationException ex) {
View Full Code Here

          if (serializer == null)
            cachedField.serializer = serializer = kryo.getRegisteredClass(cachedField.fieldClass).getSerializer();
          if (!cachedField.canBeNull)
            serializer.writeObjectData(buffer, value);
          else
            serializer.writeObject(buffer, value);
        }

        int dataLength = buffer.position() - start - 1;
        if (dataLength <= 127) {
          // Ideally it fits in one byte.
View Full Code Here

      try {
        if (TRACE) trace("kryo", "Writing property: " + property + " (" + type.getName() + ")");
        Object value = property.get(object);
        Serializer serializer = property.serializer;
        if (serializer != null)
          serializer.writeObject(buffer, value);
        else
          kryo.writeClassAndObject(buffer, value);
      } catch (IllegalAccessException ex) {
        throw new SerializationException("Error accessing getter method: " + property + " (" + type.getName() + ")", ex);
      } catch (InvocationTargetException ex) {
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.