|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.axis2.context.externalize.SafeObjectOutputStream
public class SafeObjectOutputStream
A SafeObjectOutputStream provides extra mechanisms to ensure that objects can be safely serialized to the ObjectOutput. If an Object is written to a normal ObjectOutput, the ObjectOutput is left in an unknown state if a NotSerializableException occurs. The SafeObjectOutputStream does some additonal checking to ensure that the Object can be safely written. If the Object is suspicious, it is first written to a buffer to ensure that the underlying ObjectOutput is not corrupted. In addition, SafeObjectOutputStream provides extra methods to write containers of Objects. For example the writeMap object will write the key and value pairs that are can be serialized.
SafeObjectInputStream
Field Summary | |
---|---|
static Hashtable |
notSerializableList
|
Fields inherited from interface org.apache.axis2.context.externalize.ExternalizeConstants |
---|
ACTIVE_OBJECT, EMPTY_MARKER, EMPTY_OBJECT, LAST_ENTRY, OBJ_RESTORE_PROBLEM, OBJ_SAVE_PROBLEM, UNSUPPORTED_REVID, UNSUPPORTED_SUID |
Method Summary | |
---|---|
void |
close()
|
void |
defaultWriteObject()
|
boolean |
equals(Object o)
|
void |
flush()
|
int |
hashCode()
|
static SafeObjectOutputStream |
install(ObjectOutput out)
Add the SafeOutputStream if necessary. |
ObjectOutputStream.PutField |
putFields()
|
void |
reset()
|
String |
toString()
|
void |
useProtocolVersion(int version)
|
void |
write(byte[] buf)
|
void |
write(byte[] buf,
int off,
int len)
|
void |
write(int val)
|
void |
writeBoolean(boolean val)
|
void |
writeByte(int val)
|
void |
writeBytes(String str)
|
void |
writeChar(int val)
|
void |
writeChars(String str)
|
void |
writeDouble(double val)
|
void |
writeFields()
|
void |
writeFloat(float val)
|
void |
writeInt(int val)
|
boolean |
writeItem(Object obj,
boolean isSafe)
Writes pair of objects to the stream. |
boolean |
writeList(List al)
Write a list. |
void |
writeLong(long val)
|
boolean |
writeMap(Map map)
Write a map FORMAT for null map EMPTY_OBJECT FORMAT for non-empty map ACTIVE_OBJECT for each contained key value pair writePair EMPTY_OBJECT (indicates end of the list |
void |
writeObject(Object obj)
|
boolean |
writePair(Object obj1,
boolean isSafe1,
Object obj2,
boolean isSafe2)
Writes pair of objects to the stream. |
void |
writeShort(int val)
|
void |
writeUTF(String str)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Hashtable notSerializableList
Method Detail |
---|
public static SafeObjectOutputStream install(ObjectOutput out) throws IOException
out
- Current ObjectOutput
IOException
public void close() throws IOException
close
in interface ObjectOutput
IOException
public void defaultWriteObject() throws IOException
IOException
public boolean equals(Object o)
equals
in class Object
public void flush() throws IOException
flush
in interface ObjectOutput
IOException
public int hashCode()
hashCode
in class Object
public ObjectOutputStream.PutField putFields() throws IOException
IOException
public void reset() throws IOException
IOException
public String toString()
toString
in class Object
public void useProtocolVersion(int version) throws IOException
IOException
public void write(byte[] buf, int off, int len) throws IOException
write
in interface DataOutput
write
in interface ObjectOutput
IOException
public void write(byte[] buf) throws IOException
write
in interface DataOutput
write
in interface ObjectOutput
IOException
public void write(int val) throws IOException
write
in interface DataOutput
write
in interface ObjectOutput
IOException
public void writeBoolean(boolean val) throws IOException
writeBoolean
in interface DataOutput
IOException
public void writeByte(int val) throws IOException
writeByte
in interface DataOutput
IOException
public void writeBytes(String str) throws IOException
writeBytes
in interface DataOutput
IOException
public void writeChar(int val) throws IOException
writeChar
in interface DataOutput
IOException
public void writeChars(String str) throws IOException
writeChars
in interface DataOutput
IOException
public void writeDouble(double val) throws IOException
writeDouble
in interface DataOutput
IOException
public void writeFields() throws IOException
IOException
public void writeFloat(float val) throws IOException
writeFloat
in interface DataOutput
IOException
public void writeInt(int val) throws IOException
writeInt
in interface DataOutput
IOException
public void writeLong(long val) throws IOException
writeLong
in interface DataOutput
IOException
public void writeObject(Object obj) throws IOException
writeObject
in interface ObjectOutput
IOException
public void writeShort(int val) throws IOException
writeShort
in interface DataOutput
IOException
public void writeUTF(String str) throws IOException
writeUTF
in interface DataOutput
IOException
public boolean writeMap(Map map) throws IOException
ll
-
IOException
public boolean writeList(List al) throws IOException
ll
-
IOException
public boolean writePair(Object obj1, boolean isSafe1, Object obj2, boolean isSafe2) throws IOException
obj1
- isSafe1
- true if you know that object can be safely serialized. false if the
object needs to be tested for serialization.obj2
- isSafe2
- true if you know that object can be safely serialized. false if the
object needs to be tested for serialization.
IOException
public boolean writeItem(Object obj, boolean isSafe) throws IOException
obj1
- isSafe1
- true if you know that object can be safely serialized. false if the
object needs to be tested for serialization.obj2
- isSafe2
- true if you know that object can be safely serialized. false if the
object needs to be tested for serialization.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |