public final class ClientSerializationStreamWriter extends AbstractSerializationStreamWriter
DEFAULT_FLAGS, FLAG_ELIDE_TYPE_NAMES, FLAG_RPC_TOKEN_INCLUDED, RPC_SEPARATOR_CHAR, SERIALIZATION_STREAM_JSON_VERSION, SERIALIZATION_STREAM_MAX_VERSION, SERIALIZATION_STREAM_MIN_VERSION, SERIALIZATION_STREAM_VERSION, VALID_FLAGS_MASK
Constructor and Description |
---|
ClientSerializationStreamWriter(Serializer serializer,
String moduleBaseURL,
String serializationPolicyStrongName)
Constructs a
ClientSerializationStreamWriter using the
specified module base URL and the serialization policy. |
Modifier and Type | Method and Description |
---|---|
protected void |
append(String token)
Appends a token to the end of the buffer.
|
protected String |
getObjectTypeSignature(Object o)
Compute and return the type signature for an object.
|
void |
prepareToWrite()
Call this method before attempting to append any tokens.
|
static String |
quoteString(String str)
Quote characters in a user-supplied string to make sure they are safe to
send to the server.
|
protected void |
serialize(Object instance,
String typeSignature)
Serialize an object into the stream.
|
String |
toString()
Serializes the contents of this stream into a string.
|
void |
writeLong(long value) |
addString, getAsDoubleArray, getIndexForObject, getStringTable, makeLongComponents, saveIndexForObject, writeBoolean, writeByte, writeChar, writeDouble, writeFloat, writeInt, writeObject, writeShort, writeString
addFlags, areFlagsValid, getFlags, getVersion, hasFlags, setFlags, setVersion
public ClientSerializationStreamWriter(Serializer serializer, String moduleBaseURL, String serializationPolicyStrongName)
ClientSerializationStreamWriter
using the
specified module base URL and the serialization policy.serializer
- the Serializer
to usemoduleBaseURL
- the location of the moduleserializationPolicyStrongName
- the strong name of serialization
policypublic static String quoteString(String str)
str
- string to quotepublic void prepareToWrite()
prepareToWrite
in class AbstractSerializationStreamWriter
public String toString()
SerializationStreamWriter
toString
in interface SerializationStreamWriter
toString
in class AbstractSerializationStreamWriter
public void writeLong(long value)
writeLong
in interface SerializationStreamWriter
writeLong
in class AbstractSerializationStreamWriter
protected void append(String token)
append
in class AbstractSerializationStreamWriter
token
- the token to appendprotected String getObjectTypeSignature(Object o)
AbstractSerializationStreamWriter
getObjectTypeSignature
in class AbstractSerializationStreamWriter
o
- the instance to inspectprotected void serialize(Object instance, String typeSignature) throws SerializationException
AbstractSerializationStreamWriter
serialize
in class AbstractSerializationStreamWriter
instance
- the object to serializetypeSignature
- the type signature of the objectSerializationException
Copyright © 2018. All rights reserved.