List of usage examples for com.google.gwt.user.server.rpc.impl ServerSerializationStreamWriter writeInt
public void writeInt(int fieldValue)
From source file:rocket.remoting.server.comet.CometServerServlet.java
License:Apache License
/** * Uses the GWT serialization sub-system to convert the given object into a * String. This same object will be deserialized on the client using the GWT * deserialization sub-system./* ww w. j av a 2 s . c om*/ * * @param command * The command to send. * @param object * Its okay to push null objects. * @return The serialized form of both the command and object. */ protected String serialize(final int command, final Object object) { try { ServerSerializationStreamWriter streamWriter = new ServerSerializationStreamWriter( this.createSerializationPolicy()); streamWriter.prepareToWrite(); streamWriter.writeInt(command); streamWriter.writeObject(object); return streamWriter.toString(); } catch (final SerializationException serializationException) { throw new RuntimeException( "Unable to serialize object, message: " + serializationException.getMessage()); } }