List of usage examples for com.google.gwt.rpc.server RPC streamResponseForSuccess
public static void streamResponseForSuccess(ClientOracle clientOracle, OutputStream out, Object payload) throws SerializationException
From source file:net.zschech.gwt.comet.server.impl.CometServletResponseImpl.java
License:Apache License
protected String serialize(Serializable message) throws NotSerializableException, UnsupportedEncodingException { try {//from w w w .j av a 2 s . c om if (clientOracle == null) { ServerSerializationStreamWriter streamWriter = new ServerSerializationStreamWriter( serializationPolicy); streamWriter.prepareToWrite(); streamWriter.writeObject(message); return streamWriter.toString(); } else { ByteArrayOutputStream result = new ByteArrayOutputStream(); RPC.streamResponseForSuccess(clientOracle, result, message); return new String(result.toByteArray(), "UTF-8"); } } catch (SerializationException e) { throw new NotSerializableException("Unable to serialize object, message: " + e.getMessage()); } }