|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
com.threerings.io.ObjectOutputStream
com.threerings.io.UnreliableObjectOutputStream
public class UnreliableObjectOutputStream
Extends ObjectOutputStream for use in unreliable channels, where we must transmit class
mappings with every object until we are explicitly notified that the receiver has cached the
mappings.
| Field Summary | |
|---|---|
protected Set<Class<?>> |
_mappedClasses
The set of classes for which we have written mappings. |
protected Set<String> |
_mappedInterns
The set of pooled strings for which we have written mappings. |
| Fields inherited from class com.threerings.io.ObjectOutputStream |
|---|
_classmap, _current, _internmap, _nextClassCode, _nextInternCode, _streamer, _translations |
| Fields inherited from class java.io.DataOutputStream |
|---|
written |
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
UnreliableObjectOutputStream(OutputStream target)
Constructs an object output stream which will write its data to the supplied target stream. |
|
| Method Summary | |
|---|---|
protected com.threerings.io.ClassMapping |
createClassMapping(short code,
Class<?> sclass,
Streamer streamer)
Creates and returns a new class mapping. |
protected Short |
createInternMapping(short code)
Creates and returns a new intern mapping. |
Set<Class<?>> |
getMappedClasses()
Returns a reference to the set of classes for which mappings have been written. |
Set<String> |
getMappedInterns()
Returns a reference to the set of pooled strings for which mappings have been written. |
void |
noteClassMappingsReceived(Collection<Class<?>> sclasses)
Notes that the receiver has received the mappings for a group of classes and thus that from now on, only the codes need be sent. |
void |
noteInternMappingsReceived(Collection<String> sinterns)
Notes that the receiver has received the mappings for a group of interns and thus that from now on, only the codes need be sent. |
void |
setMappedClasses(Set<Class<?>> mappedClasses)
Sets the reference to the set that will hold the classes for which mappings have been written. |
void |
setMappedInterns(Set<String> mappedInterns)
Sets the reference to the set that will hold the pooled strings for which mappings have been written. |
protected void |
writeClassMapping(int code,
Class<?> sclass)
Writes out the mapping for a class. |
protected void |
writeExistingClassMapping(com.threerings.io.ClassMapping cmap)
Writes an existing class mapping to the stream. |
protected void |
writeExistingInternMapping(short code,
String value)
Writes an existing intern mapping to the stream. |
protected void |
writeInternMapping(int code,
String value)
Writes out the mapping for an intern. |
protected void |
writeNewClassMapping(com.threerings.io.ClassMapping cmap)
Writes a new class mapping to the stream. |
protected void |
writeNewInternMapping(short code,
String value)
Writes a new intern mapping to the stream. |
| Methods inherited from class com.threerings.io.ObjectOutputStream |
|---|
addTranslation, defaultWriteObject, writeBareObject, writeBareObject, writeClassMapping, writeIntern, writeObject, writeUnmodifiedUTF |
| Methods inherited from class java.io.DataOutputStream |
|---|
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
| Methods inherited from class java.io.FilterOutputStream |
|---|
close, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.io.DataOutput |
|---|
write |
| Field Detail |
|---|
protected Set<Class<?>> _mappedClasses
protected Set<String> _mappedInterns
| Constructor Detail |
|---|
public UnreliableObjectOutputStream(OutputStream target)
| Method Detail |
|---|
public void setMappedClasses(Set<Class<?>> mappedClasses)
public Set<Class<?>> getMappedClasses()
public void setMappedInterns(Set<String> mappedInterns)
public Set<String> getMappedInterns()
public void noteClassMappingsReceived(Collection<Class<?>> sclasses)
public void noteInternMappingsReceived(Collection<String> sinterns)
protected Short createInternMapping(short code)
ObjectOutputStream
createInternMapping in class ObjectOutputStream
protected void writeNewInternMapping(short code,
String value)
throws IOException
ObjectOutputStream
writeNewInternMapping in class ObjectOutputStreamIOException
protected void writeExistingInternMapping(short code,
String value)
throws IOException
ObjectOutputStream
writeExistingInternMapping in class ObjectOutputStreamIOException
protected void writeInternMapping(int code,
String value)
throws IOException
ObjectOutputStream
writeInternMapping in class ObjectOutputStreamIOException
protected com.threerings.io.ClassMapping createClassMapping(short code,
Class<?> sclass,
Streamer streamer)
ObjectOutputStream
createClassMapping in class ObjectOutputStream
protected void writeNewClassMapping(com.threerings.io.ClassMapping cmap)
throws IOException
ObjectOutputStream
writeNewClassMapping in class ObjectOutputStreamIOException
protected void writeExistingClassMapping(com.threerings.io.ClassMapping cmap)
throws IOException
ObjectOutputStream
writeExistingClassMapping in class ObjectOutputStreamIOException
protected void writeClassMapping(int code,
Class<?> sclass)
throws IOException
ObjectOutputStream
writeClassMapping in class ObjectOutputStreamIOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||