src/share/classes/java/io/ObjectOutputStream.java

Print this page
rev 10048 : 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
Reviewed-by:


 139  * fixed serialVersionUID of 0L.
 140  *
 141  * <p>Primitive data, excluding serializable fields and externalizable data, is
 142  * written to the ObjectOutputStream in block-data records. A block data record
 143  * is composed of a header and data. The block data header consists of a marker
 144  * and the number of bytes to follow the header.  Consecutive primitive data
 145  * writes are merged into one block-data record.  The blocking factor used for
 146  * a block-data record will be 1024 bytes.  Each block-data record will be
 147  * filled up to 1024 bytes, or be written whenever there is a termination of
 148  * block-data mode.  Calls to the ObjectOutputStream methods writeObject,
 149  * defaultWriteObject and writeFields initially terminate any existing
 150  * block-data record.
 151  *
 152  * @author      Mike Warres
 153  * @author      Roger Riggs
 154  * @see java.io.DataOutput
 155  * @see java.io.ObjectInputStream
 156  * @see java.io.Serializable
 157  * @see java.io.Externalizable
 158  * @see <a href="../../../platform/serialization/spec/output.html">Object Serialization Specification, Section 2, Object Output Classes</a>
 159  * @since       JDK1.1
 160  */
 161 public class ObjectOutputStream
 162     extends OutputStream implements ObjectOutput, ObjectStreamConstants
 163 {
 164 
 165     private static class Caches {
 166         /** cache of subclass security audit results */
 167         static final ConcurrentMap<WeakClassKey,Boolean> subclassAudits =
 168             new ConcurrentHashMap<>();
 169 
 170         /** queue for WeakReferences to audited subclasses */
 171         static final ReferenceQueue<Class<?>> subclassAuditsQueue =
 172             new ReferenceQueue<>();
 173     }
 174 
 175     /** filter stream for handling block data conversion */
 176     private final BlockDataOutputStream bout;
 177     /** obj -> wire handle map */
 178     private final HandleTable handles;
 179     /** obj -> replacement obj map */




 139  * fixed serialVersionUID of 0L.
 140  *
 141  * <p>Primitive data, excluding serializable fields and externalizable data, is
 142  * written to the ObjectOutputStream in block-data records. A block data record
 143  * is composed of a header and data. The block data header consists of a marker
 144  * and the number of bytes to follow the header.  Consecutive primitive data
 145  * writes are merged into one block-data record.  The blocking factor used for
 146  * a block-data record will be 1024 bytes.  Each block-data record will be
 147  * filled up to 1024 bytes, or be written whenever there is a termination of
 148  * block-data mode.  Calls to the ObjectOutputStream methods writeObject,
 149  * defaultWriteObject and writeFields initially terminate any existing
 150  * block-data record.
 151  *
 152  * @author      Mike Warres
 153  * @author      Roger Riggs
 154  * @see java.io.DataOutput
 155  * @see java.io.ObjectInputStream
 156  * @see java.io.Serializable
 157  * @see java.io.Externalizable
 158  * @see <a href="../../../platform/serialization/spec/output.html">Object Serialization Specification, Section 2, Object Output Classes</a>
 159  * @since       1.1
 160  */
 161 public class ObjectOutputStream
 162     extends OutputStream implements ObjectOutput, ObjectStreamConstants
 163 {
 164 
 165     private static class Caches {
 166         /** cache of subclass security audit results */
 167         static final ConcurrentMap<WeakClassKey,Boolean> subclassAudits =
 168             new ConcurrentHashMap<>();
 169 
 170         /** queue for WeakReferences to audited subclasses */
 171         static final ReferenceQueue<Class<?>> subclassAuditsQueue =
 172             new ReferenceQueue<>();
 173     }
 174 
 175     /** filter stream for handling block data conversion */
 176     private final BlockDataOutputStream bout;
 177     /** obj -> wire handle map */
 178     private final HandleTable handles;
 179     /** obj -> replacement obj map */