
public abstract class AbstractSerializationStreamWriter extends AbstractSerializationStream implements SerializationStreamWriter
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 |
|---|
AbstractSerializationStreamWriter() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
addString(String string)
Add a string to the string table and return its index.
|
protected abstract void |
append(String token)
Append a token to the underlying output buffer.
|
static double[] |
getAsDoubleArray(long value)
Return a pair of doubles { low, high } that add up to the given number,
such that "low" is always between 0 and 2^32-1 inclusive and "high" is
always between -2^63 and 2^63-2^32 inclusive and is a multiple of 2^32.
|
protected int |
getIndexForObject(Object instance)
Get the index for an object that may have previously been saved via
saveIndexForObject(Object). |
protected abstract String |
getObjectTypeSignature(Object instance)
Compute and return the type signature for an object.
|
protected List<String> |
getStringTable()
Gets the string table.
|
protected static double[] |
makeLongComponents(int lowBits,
int highBits) |
void |
prepareToWrite() |
protected void |
saveIndexForObject(Object instance)
Remember this object as having been seen before.
|
protected abstract void |
serialize(Object instance,
String typeSignature)
Serialize an object into the stream.
|
abstract String |
toString()
Serializes the contents of this stream into a string.
|
void |
writeBoolean(boolean fieldValue) |
void |
writeByte(byte fieldValue) |
void |
writeChar(char ch) |
void |
writeDouble(double fieldValue) |
void |
writeFloat(float fieldValue) |
void |
writeInt(int fieldValue) |
abstract void |
writeLong(long value) |
void |
writeObject(Object instance) |
void |
writeShort(short value) |
void |
writeString(String value) |
addFlags, areFlagsValid, getFlags, getVersion, hasFlags, setFlags, setVersionpublic static double[] getAsDoubleArray(long value)
protected static double[] makeLongComponents(int lowBits,
int highBits)
public void prepareToWrite()
public abstract String toString()
SerializationStreamWritertoString in interface SerializationStreamWritertoString in class Objectpublic void writeBoolean(boolean fieldValue)
writeBoolean in interface SerializationStreamWriterpublic void writeByte(byte fieldValue)
writeByte in interface SerializationStreamWriterpublic void writeChar(char ch)
writeChar in interface SerializationStreamWriterpublic void writeDouble(double fieldValue)
writeDouble in interface SerializationStreamWriterpublic void writeFloat(float fieldValue)
writeFloat in interface SerializationStreamWriterpublic void writeInt(int fieldValue)
writeInt in interface SerializationStreamWriterpublic abstract void writeLong(long value)
writeLong in interface SerializationStreamWriterpublic void writeObject(Object instance) throws SerializationException
writeObject in interface SerializationStreamWriterSerializationExceptionpublic void writeShort(short value)
writeShort in interface SerializationStreamWriterpublic void writeString(String value)
writeString in interface SerializationStreamWriterprotected int addString(String string)
string - the string to addprotected abstract void append(String token)
token - the token to appendprotected int getIndexForObject(Object instance)
saveIndexForObject(Object).instance - the object to saveprotected abstract String getObjectTypeSignature(Object instance) throws SerializationException
instance - the instance to inspectSerializationExceptionprotected void saveIndexForObject(Object instance)
instance - the object to rememberprotected abstract void serialize(Object instance, String typeSignature) throws SerializationException
instance - the object to serializetypeSignature - the type signature of the objectSerializationExceptionCopyright © 2018. All rights reserved.