public synchronized Object read (Connection connection, ByteBuffer buffer) { input.setBuffer(buffer); kryo.getContext().put("connection", connection); return kryo.readClassAndObject(input); }
public Object read (Kryo kryo, Input input, Class type) { int objectID = input.readInt(true); Connection connection = (Connection)kryo.getContext().get("connection"); return ObjectSpace.getRemoteObject(connection, objectID, type); } }
public Object read (Kryo kryo, Input input, Class type) { int objectID = input.readInt(true); Connection connection = (Connection)kryo.getContext().get("connection"); Object object = getRegisteredObject(connection, objectID); if (WARN && object == null) warn("kryonet", "Unknown object ID " + objectID + " for connection: " + connection); return object; } });
public void write (Kryo kryo, Output output, Object object) { Connection connection = (Connection)kryo.getContext().get("connection"); int id = getRegisteredID(connection, object); if (id == Integer.MAX_VALUE) throw new KryoNetException("Object not found in an ObjectSpace: " + object); output.writeInt(id, true); }
public synchronized void write (Connection connection, ByteBuffer buffer, Object object) { output.setBuffer(buffer); kryo.getContext().put("connection", connection); kryo.writeClassAndObject(output, object); output.flush(); }
/** * * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public Object read(Connection connection, InputStream inputStream) { Input input = new Input(inputStream); IKryoProvider kryoProvider = serializerQueue.poll(); // if nothing is available in queue don't wait, create new one if (null == kryoProvider) { kryoProvider = createKryoProvider(); } try { Kryo kryo = kryoProvider.getKryo(); kryo.getContext().put("connection", connection); return kryo.readClassAndObject(input); } finally { serializerQueue.offer(kryoProvider); } }
public Object read (Kryo kryo, Input input, Class type) { int objectID = input.readInt(true); Connection connection = (Connection)kryo.getContext().get("connection"); return ObjectSpace.getRemoteObject(connection, objectID, type); } }
public synchronized Object read (Connection connection, ByteBuffer buffer) { input.setBuffer(buffer); kryo.getContext().put("connection", connection); return kryo.readClassAndObject(input); }
/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public void write(Connection connection, OutputStream outputStream, Object object) { Output output = new Output(outputStream); IKryoProvider kryoProvider = serializerQueue.poll(); // if nothing is available in queue don't wait, create new one if (null == kryoProvider) { kryoProvider = createKryoProvider(); } try { Kryo kryo = kryoProvider.getKryo(); kryo.getContext().put("connection", connection); kryo.writeClassAndObject(output, object); output.flush(); } finally { serializerQueue.offer(kryoProvider); } }
public void write (Kryo kryo, Output output, Object object) { Connection connection = (Connection)kryo.getContext().get("connection"); int id = getRegisteredID(connection, object); if (id == Integer.MAX_VALUE) throw new KryoNetException("Object not found in an ObjectSpace: " + object); output.writeInt(id, true); }
public synchronized void write (Connection connection, ByteBuffer buffer, Object object) { output.setBuffer(buffer); kryo.getContext().put("connection", connection); kryo.writeClassAndObject(output, object); output.flush(); }
@Override public Object read(Kryo kryo, Input input, Class type) { int objectID = input.readInt(true); Connection connection = (Connection) kryo.getContext().get("connection"); Object object = getRegisteredObject(connection, objectID); if (WARN && (object == null)) { warn("kryonet", "Unknown object ID " + objectID + " for connection: " + connection); } return object; } }, nextRegistrationId++);
public Object read (Kryo kryo, Input input, Class type) { int objectID = input.readInt(true); Connection connection = (Connection)kryo.getContext().get("connection"); Object object = getRegisteredObject(connection, objectID); if (WARN && object == null) warn("kryonet", "Unknown object ID " + objectID + " for connection: " + connection); return object; } });
ObjectMap context = kryo.getContext();
ObjectMap context = kryo.getContext();
ObjectMap context = kryo.getContext();
ObjectMap context = kryo.getContext();