Package com.google.gwt.user.server.rpc.impl

Examples of com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter


   *            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());
    }
  }
View Full Code Here


   */
  private static String encodeResponse(Class<?> responseClass, Object object,
      boolean wasThrown, int flags, SerializationPolicy serializationPolicy)
      throws SerializationException {

    ServerSerializationStreamWriter stream = new ServerSerializationStreamWriter(
        serializationPolicy);
    stream.setFlags(flags);

    stream.prepareToWrite();
    if (responseClass != void.class) {
      stream.serializeValue(object, responseClass);
    }

    String bufferStr = (wasThrown ? "//EX" : "//OK") + stream.toString();
    return bufferStr;
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter

Copyright © 2018 www.massapicom. 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.