public class SafeObjectOutputStream extends Object implements ObjectOutput, ObjectStreamConstants, ExternalizeConstants
SafeObjectInputStream
Modifier and Type | Field and Description |
---|---|
static Hashtable |
notSerializableList |
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
ACTIVE_OBJECT, EMPTY_MARKER, EMPTY_OBJECT, LAST_ENTRY, OBJ_RESTORE_PROBLEM, OBJ_SAVE_PROBLEM, UNSUPPORTED_REVID, UNSUPPORTED_SUID
Modifier and Type | Method and Description |
---|---|
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) |
public static final Hashtable notSerializableList
public static SafeObjectOutputStream install(ObjectOutput out) throws IOException
out
- Current ObjectOutputIOException
public void close() throws IOException
close
in interface ObjectOutput
close
in interface AutoCloseable
IOException
public void defaultWriteObject() throws IOException
IOException
public void flush() throws IOException
flush
in interface ObjectOutput
IOException
public ObjectOutputStream.PutField putFields() throws IOException
IOException
public void reset() throws IOException
IOException
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
Copyright © 2004–2015 The Apache Software Foundation. All rights reserved.