com.google.gwt.user.client.rpc
Class SerializationStream

java.lang.Object
  extended bycom.google.gwt.user.client.rpc.SerializationStream
All Implemented Interfaces:
SerializationStreamObjectDecoder, SerializationStreamObjectEncoder, SerializationStreamReader, SerializationStreamWriter, StringTable
Direct Known Subclasses:
ClientSerializationStream, ServerSerializationStream

public abstract class SerializationStream
extends Object
implements SerializationStreamReader, SerializationStreamWriter, SerializationStreamObjectDecoder, SerializationStreamObjectEncoder, StringTable

Base class for the client and server serialization streams. This class handles the basic serialization and desirialization formatting for primitive types since these are common between the client and the server.


Field Summary
protected  int flags
           
static String NEW_INSTANCE_MARKER
           
static String NULL_INSTANCE_MARKER
           
static String PREV_INSTANCE_MARKER
           
static int SERIALIZATION_STREAM_FLAGS_NO_TYPE_VERSIONING
           
static int SERIALIZATION_STREAM_VERSION
           
protected  int version
           
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
SerializationStream()
           
 
Method Summary
 void addFlags(int flags)
           
protected abstract  void append(String string)
           
protected abstract  String extract()
           
 int getFlags()
           
abstract  SerializationStreamObjectDecoder getObjectDecoder()
           
abstract  SerializationStreamObjectEncoder getObjectEncoder()
           
 int getVersion()
           
abstract  void prepareToRead(String encodedString)
           
abstract  void prepareToWrite()
           
 boolean readBoolean()
           
 byte readByte()
           
 char readChar()
          Character.MinValue and Character.MaxValue are special or cause special problems.
 double readDouble()
           
 float readFloat()
           
 int readInt()
           
 long readLong()
           
 short readShort()
           
 void setFlags(int flags)
           
protected  void setVersion(int version)
           
 boolean shouldEnforceTypeVersioning()
           
 void writeBoolean(boolean fieldValue)
           
 void writeByte(byte fieldValue)
           
 void writeChar(char ch)
          Character.MinValue and Character.MaxValue are special or cause special problems.
 void writeDouble(double fieldValue)
           
 void writeFloat(float fieldValue)
           
 void writeInt(int fieldValue)
           
 void writeLong(long fieldValue)
           
 void writeShort(short value)
           
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode, toString
 
Methods inherited from interface com.google.gwt.user.client.rpc.SerializationStreamReader
readObject
 
Methods inherited from interface com.google.gwt.user.client.rpc.SerializationStreamWriter
writeObject
 
Methods inherited from interface com.google.gwt.user.client.rpc.SerializationStreamObjectDecoder
getStringTable, nextInstance, prevInstance, rememberDecodedObject
 
Methods inherited from interface com.google.gwt.user.client.rpc.SerializationStreamObjectEncoder
endInstance, getStringTable, startInstance
 
Methods inherited from interface com.google.gwt.user.client.rpc.StringTable
addString, getString, getStringCount
 

Field Detail

NEW_INSTANCE_MARKER

public static final String NEW_INSTANCE_MARKER
See Also:
Constant Field Values

PREV_INSTANCE_MARKER

public static final String PREV_INSTANCE_MARKER
See Also:
Constant Field Values

NULL_INSTANCE_MARKER

public static final String NULL_INSTANCE_MARKER
See Also:
Constant Field Values

SERIALIZATION_STREAM_VERSION

public static final int SERIALIZATION_STREAM_VERSION
See Also:
Constant Field Values

SERIALIZATION_STREAM_FLAGS_NO_TYPE_VERSIONING

public static final int SERIALIZATION_STREAM_FLAGS_NO_TYPE_VERSIONING
See Also:
Constant Field Values

flags

protected int flags

version

protected int version
Constructor Detail

SerializationStream

public SerializationStream()
Method Detail

addFlags

public void addFlags(int flags)

getFlags

public int getFlags()

setFlags

public void setFlags(int flags)

setVersion

protected void setVersion(int version)

getVersion

public int getVersion()

shouldEnforceTypeVersioning

public boolean shouldEnforceTypeVersioning()

append

protected abstract void append(String string)

extract

protected abstract String extract()

prepareToRead

public abstract void prepareToRead(String encodedString)

prepareToWrite

public abstract void prepareToWrite()

getObjectDecoder

public abstract SerializationStreamObjectDecoder getObjectDecoder()
Specified by:
getObjectDecoder in interface SerializationStreamReader

readBoolean

public boolean readBoolean()
Specified by:
readBoolean in interface SerializationStreamReader

readByte

public byte readByte()
Specified by:
readByte in interface SerializationStreamReader

readChar

public char readChar()
Character.MinValue and Character.MaxValue are special or cause special problems. Character.MaxValue is used as the stream token delimiter so it is special cased here. Character.MinValue is causes problems on the server when the payload of the request is converted to UTF8. So, we escape them here

Specified by:
readChar in interface SerializationStreamReader

readDouble

public double readDouble()
Specified by:
readDouble in interface SerializationStreamReader

readFloat

public float readFloat()
Specified by:
readFloat in interface SerializationStreamReader

readInt

public int readInt()
Specified by:
readInt in interface SerializationStreamReader

readLong

public long readLong()
Specified by:
readLong in interface SerializationStreamReader

readShort

public short readShort()
Specified by:
readShort in interface SerializationStreamReader

getObjectEncoder

public abstract SerializationStreamObjectEncoder getObjectEncoder()
Specified by:
getObjectEncoder in interface SerializationStreamWriter

writeBoolean

public void writeBoolean(boolean fieldValue)
Specified by:
writeBoolean in interface SerializationStreamWriter

writeByte

public void writeByte(byte fieldValue)
Specified by:
writeByte in interface SerializationStreamWriter

writeChar

public void writeChar(char ch)
Character.MinValue and Character.MaxValue are special or cause special problems. Character.MaxValue is used as the stream token delimiter so it is special cased here. Character.MinValue is causes problems on the server when the payload of the request is converted to UTF8 (not really certain why). So, we escape them here

Specified by:
writeChar in interface SerializationStreamWriter

writeDouble

public void writeDouble(double fieldValue)
Specified by:
writeDouble in interface SerializationStreamWriter

writeFloat

public void writeFloat(float fieldValue)
Specified by:
writeFloat in interface SerializationStreamWriter

writeInt

public void writeInt(int fieldValue)
Specified by:
writeInt in interface SerializationStreamWriter

writeLong

public void writeLong(long fieldValue)
Specified by:
writeLong in interface SerializationStreamWriter

writeShort

public void writeShort(short value)
Specified by:
writeShort in interface SerializationStreamWriter


This javadoc distribution was not produced by Google. The official documentation is here.